object.add("uiold","dom",function(_1,_2){
this.Component=new Class(_2.Element,function(){
this.initialize=function(_3){
_2.Element.initialize(_3);
};
this._render1=function(_4,_5,_6){
for(var i in _6){
_5.addEvent(i,_6[i]);
}
};
this._getTriggers=function(_8,_9){
var _a={};
for(var i in _9){
var _c=i.match(/^on(.+)/i);
if(_c){
_a[_c[1]]=_9[i];
}
}
return _a;
};
this.render=function(_d,_e,_f){
if(!_f){
_f={};
}
if(_d.selectors&&_e in _d.selectors){
name=_e;
_e=_d.selectors[_e];
}
var _10=_d.getElements(_e);
_10.forEach(function(ele){
if(_f.type){
_f.type.wrap(ele);
}
});
var _12=_d._getTriggers(_f);
for(i=0;i<_10.length;i++){
_d._render1(_10[i],_12);
}
if(name){
_d[name]=_10;
}
return _10;
};
this.render1=function(_13,_14,_15){
if(!_15){
_15={};
}
if(_13.selectors&&_14 in _13.selectors){
name=_14;
_14=_13.selectors[_14];
}
var ele=_13.getElement(_14);
if(_15.type){
_15.type.wrap(ele);
}
var _17=_13._getTriggers(_15);
_13._render1(ele,_17);
if(name){
_13[name]=ele;
}
return ele;
};
this.bind=function(_18,_19){
return function(){
_18[_19].apply(_18,[].slice.call(arguments,0));
_18.fireEvent(_19,arguments[0],_18);
};
};
this.call=function(_1a,_1b){
_1a[_1b].apply(_1a,[].slice.call(arguments,0));
_1a.fireEvent(_1b,arguments[0],_1a);
};
this.makeOption=function(_1c,_1d,_1e){
_1d=_1d.toLowerCase();
var _1f=_1c.getData(_1d);
if(_1e===Boolean){
_1f=(_1f==="true");
}else{
if(_1e===Number){
_1f=Number(_1f);
}
}
if(_1f===null||_1f===undefined||_1f===NaN){
return null;
}
return _1f;
};
this.wrap=classmethod(function(cls,ele){
if(!ele){
return null;
}
if(ele._wrapper){
if(ele._wrapper===cls){
return ele;
}
var _22=Class.getChain(ele._wrapper);
if(_22.indexOf(cls)!==-1){
return ele;
}
var _23=Class.getChain(cls);
if(_23.indexOf(ele._wrapper)===-1){
throw "\u5305\u88c5\u51fa\u9519\uff0c\u4e00\u4e2a\u5143\u7d20\u53ea\u80fd\u6709\u4e00\u4e2a\u5305\u88c5\u7c7b";
}
}
Class.inject(cls,ele,function(_24,src,_26){
if(typeof src[_26]!="function"){
if(!(_26 in _24)){
return true;
}else{
return false;
}
}else{
return true;
}
});
ele._wrapper=cls;
return ele;
});
});
this.TabControl=new Class(_1.Component,function(){
this.initialize=function(_27){
_1.Component.initialize(_27);
_27.tabs=_2.getElements("li",_27);
_27.selectedEle=null;
for(var i=0;i<_27.tabs.length;i++){
if(_2.wrap(_27.tabs[i]).classList.contains("selected")){
_27.selectedEle=_27.tabs[i];
break;
}
}
_27.tabs.forEach(function(ele,i){
ele=_2.wrap(ele);
ele.addEvent("click",function(){
_27.tabs.forEach(function(tab,i){
_2.wrap(tab).classList.remove("selected");
});
_27.selectedEle=ele;
ele.classList.add("selected");
_27.fireEvent("change",{tab:_27});
});
});
};
});
this.ForeNextControl=new Class(_1.Component,function(){
this.initialize=function(_2d){
_1.Component.initialize(_2d);
_2d.total=parseInt(_2d.getData("total"));
_2d.start=parseInt(_2d.getData("start"))||0;
_2d.position=_2d.start;
_2d.render(".nextbutton",{onclick:_2d.bind("next")});
_2d.render(".forebutton",{onclick:_2d.bind("fore")});
};
this.next=function(_2e){
_2e.position++;
_2e.call("change");
};
this.fore=function(_2f){
_2f.position--;
_2f.call("change");
};
this.change=function(_30){
_30.call("updateTotal");
_30.call("updatePosition");
};
this.updatePosition=function(_31){
_31.getElements(".current").set("html",_31.position);
};
this.updateTotal=function(_32){
_32.getElements(".total").set("html",_32.total);
};
});
});
object.add("xn.feed","dom, events, uiold, mvc, net, options",function(_33,dom,_35,_36,mvc,net,_39){
this.AsyncArray=new Class(Array,function(){
Class.mixin(this,_35.Events);
this.initialize=function(_3a,_3b){
_3a._eventListeners={};
if(!_3b){
_3b={};
}
_3a.length=0;
_3a.action=_3b.action||"";
_3a.method=_3b.method||"get";
_3a.params=_3b.params||"";
_3a.contentType=_3b.contentType||"text/plain";
_3a.loading=false;
_3a.autoLoad=false;
_3a.needToLoad=5;
_3a.position=0;
_3a.dataParser=_3b.dataParser||null;
_3a.paramsParser=_3b.paramsParser||null;
};
this.clear=function(_3c){
_3c.length=0;
_3c.position=0;
};
this.fetch=function(_3d,_3e,_3f){
function doCallback(){
var _40=_3d.slice(_3d.position,_3d.position+_3e);
_3f(_40);
_3d.position+=_3e;
if(_40.length&&_3d.autoLoad){
if(_3d.length-_3d.position<_3d.needToLoad){
_3d.load();
}
}
}
if(_3d.length-_3d.position<_3e){
if(_3d.length===0||_3d.autoLoad){
_3d.load(doCallback);
}else{
_3d.fireEvent("nomoredata");
}
}else{
doCallback();
}
};
this.load=function(_41,_42){
if(_41.loading){
return;
}
var _43=_41.params?_41.params:_41.paramsParser(_41);
_41.loading=true;
var _44=new net.Request({url:_41.action,method:_41.method,onsuccess:function(_45){
var _46=_41.dataParser.call(_41,_45.request);
for(var i=0;i<_46.length;i++){
_41.push(_46[i]);
}
_41.loading=false;
if(_42){
_42();
}
_41.fireEvent("load");
}});
_44.send(_43);
if(COMSCORE){
COMSCORE.beacon({c1:2,c2:6934070,c3:"",c4:"",c5:"",c6:"",c15:""});
}
};
this.parse=function(_48,r){
if(_48.contentType=="text/json"){
return JSON.parse(r);
}
};
});
this.FeedAction=new Class(mvc.Action,function(){
this.initialize=function(_4a,_4b){
mvc.Action.prototype.initialize.call(_4a,_4b);
if(!_4b){
_4b={};
}
_4a.markReadAction=_4b.markReadAction||"";
_4a.readMoreAction=_4b.readMoreAction||"";
_4a.userId=_4b.userId||"";
_4a.hostId=_4b.hostId||"";
_4a.data=null;
_4a.view=null;
_4a.itemsPerPage=_4b.itemsPerPage||20;
};
this.append=function(_4c,_4d){
if(!_4d){
_4d=_4c.itemsPerPage;
}
_4c.fireEvent("beforeappend");
_4c.data.fetch(_4d,function(_4e){
if(!_4e||!_4e.length){
_4c.fireEvent("nomoredata");
}else{
for(var i=0;i<_4e.length;i++){
_4c.view.appendNewsfeed(_4e[i]);
}
_4c.fireEvent("append");
}
});
};
this.execute=function(_50,_51){
mvc.Action.prototype.execute.call(_50,_51);
_50.initData(_50.view.getFeeds());
if(!_50.data.length){
_50.append(_50.itemsPerPage);
}
};
this.initData=function(_52,_53){
_52.data=new _33.AsyncArray({dataParser:_52.dataParser,paramsParser:function(){
var p=0;
if(_52.data.length){
p=Math.round(_52.data.length/_52.itemsPerPage);
if(p===0){
p=1;
}
}
var _55="p="+p;
if(_52.currentCategory){
_55+="&f="+_52.currentCategory.id;
}
if(_52.userId){
_55+="&u="+_52.userId;
}
if(_52.hostId){
_55+="&host="+_52.hostId;
}
return _55;
}});
if(_53){
for(var i=0;i<_53.length;i++){
_52.data.push(_53[i]);
}
_52.data.position=_53.length;
}
_52.data.method="post";
_52.data.action=_52.readMoreAction;
_52.data.autoLoad=true;
_52.data.needToLoad=0;
};
this.markRead=function(_57,id){
var _59="t=s&i="+id;
if(_57.userId){
_59+="&u="+_57.userId;
}
if(_57.userId){
_59+="&host="+_57.host;
}
var _5a=new net.Request({url:_57.markReadAction,method:"post",onsuccess:function(_5b){
_57.view.removeNewsfeed(id);
_57.fireEvent("markread");
}});
_5a.send(_59);
};
this.markAllRead=function(_5c){
var _5d=new net.Request({url:_5c.markReadAction,method:"post",onsuccess:function(){
_5c.view.clearNewsfeed();
_5c.fireEvent("markallread");
}});
_5d.send("t=a");
};
this.reload=function(_5e){
_5e.view.clearNewsfeed();
_5e.fireEvent("beforereload");
_5e.initData();
_5e.append(_5e.itemsPerPage);
};
this.dataParser=staticmethod(function(r){
r=r.responseText.split("##@L#");
var _60={html:r[0],start:r[1],end:r[2],length:r[3]};
var tmp=document.createElement("div");
dom.wrap(tmp).setHTML(_60.html);
return tmp.children;
});
});
this.FeedUI=new Class(_36.Component,function(){
this.initialize=function(_62,_63){
_36.Component.initialize(_62);
_62.selectors={similarButton:".similar-feed p a",list:".feed-list",loadingDiv:".feed-loading",nomoreDiv:".nomore-feed",categoryFilter:".feed-categories"};
};
this.appendNewsfeed=function(_64,ele){
if(dom.id(ele.id)){
return;
}
_64.list.appendChild(ele);
XN.element.eval_inner_JS(ele);
};
this.appendNewsfeeds=function(_66,_67){
var _68=document.createDocumentFragment();
for(var i=0;i<_67.length;i++){
if(!dom.id(_67[i].id)){
_68.appendChild(_67[i]);
}
}
_66.list.appendChild(_68);
};
this.clearNewsfeed=function(_6a,ele){
_6a.list.innerHTML="";
};
this.insertNewsfeed=function(_6c,id,_6e){
var ele=dom.id("newsfeed-"+id);
for(var i=0;i<_6e.length;i++){
ele.parentNode.insertBefore(_6e[i],ele.nextSibling);
XN.element.eval_inner_JS(_6e[i]);
}
};
this.removeNewsfeed=function(_71,id){
var ele=dom.id("newsfeed-"+id,_71);
ele.parentNode.removeChild(ele);
};
this.getCategories=function(_74){
var _75=dom.getElements(".feed-category",_74);
var _76=[];
_75.forEach(function(ele,i){
_76.push({id:parseInt(ele.getAttribute("data-id")),name:ele.innerText});
});
return _76;
};
this.getCurrentType=function(_79){
if(_79.typeTabs.length){
var _7a="hot";
if(_79.typeTabs[0].selectedEle){
_7a=_79.typeTabs[0].selectedEle.getData("id");
}
return _7a;
}
};
this.getUserId=function(_7b){
return _7b.getData("userid");
};
this.getFeeds=function(_7c){
return _7c.list.children;
};
this.getOptions=function(_7d){
var _7e=new _39.Options(_7d);
_7e.setOption("categories",Array,_7d.getCategories(_7d));
_7e.setOption("loadOnScroll",Boolean);
_7e.setOption("hostId");
_7e.setOption("userId");
_7e.setOption("similarAction");
_7e.setOption("markReadAction");
_7e.setOption("readMoreAction");
return _7e.getOptions();
};
this.setCookieBySecond=function(_7f,_80,_81,_82,_83,_84,_85){
var _86;
if(isNumber(_82)){
var _87=new Date();
var _88=new Date(_87.getTime()+(_82*1000));
_86=_88.toGMTString();
}else{
if(isString(_82)){
_86=_82;
}else{
_86=false;
}
}
_84=_84||XN.env.domain;
_83="/";
document.cookie=_80+"="+encodeURIComponent(_81)+(_86?";expires="+_86:"")+(_83?";path="+_83:"")+(_84?";domain="+_84:"")+(_85?";secure":"");
};
this.load=function(_89,_8a){
_8a.addEvent("beforeappend",function(){
_89.loadingDiv.show();
_89.nomoreDivs.hide();
_89.moreButtons.hide();
_89.markAllReadButtons.hide();
});
_8a.addEvent("append",function(){
_89.loadingDiv.hide();
_89.nomoreDivs.hide();
_89.moreButtons.show();
_89.markAllReadButtons.show();
});
_8a.addEvent("nomoredata",function(){
_89.loadingDiv.hide();
_89.nomoreDivs.forEach(function(_8b){
if(!_8a.currentCategory&&!_8b.getData("forcategoryid")){
_8b.show();
}else{
if(_8a.currentCategory&&_8b.getData("forcategoryid")==_8a.currentCategory.id){
_8b.show();
}else{
_8b.hide();
}
}
});
_89.moreButtons.hide();
_89.markAllReadButtons.show();
});
_89.delegate(".delete","click",function(e){
e.preventDefault();
var id=dom.wrap(this).getParent(".a-feed").getData("idlist");
if(!id){
id=dom.wrap(this).getParent(".a-feed").id.match(/newsfeed-(\d+)/i)[1];
}
var _8e=dom.wrap(this).getParent(".a-feed");
var _8f=dom.getElements("aside figure",_8e)[0];
var _90={id:_8f.getData("id"),name:_8f.getData("name")};
_8a.markRead(id,_90.id);
});
_89.delegate(".a-feed .feed-focus-user","click",function(e){
var _92=dom.wrap(this).getParent(".a-feed");
var _93=dom.getElements("aside figure",_92)[0];
var _94={id:_93.getData("id"),name:_93.getData("name")};
object.use("xn.attentionuser.popups",function(X,xn){
xn.attentionuser.popups.showAttentionWindow(_94);
});
});
_89.delegate(".a-feed .feed-block-user","click",function(e){
var _98=dom.wrap(this).getParent(".a-feed");
var _99=dom.getElements("aside figure",_98)[0];
var _9a={id:_99.getData("id"),name:_99.getData("name")};
object.use("xn.attentionuser.popups",function(X,xn){
xn.attentionuser.popups.showBlockWindow(_9a);
});
});
_89.delegate(_89.selectors.similarButton,"click",function(e){
e.preventDefault();
var id=this.getParent(".a-feed").id.match(/newsfeed-(\d+)/i)[1];
var ids=this.getData("similar-feeds");
ids=ids.split(",");
ids.pop();
_8a.showSimilarNewsfeeds(id,ids);
});
_8a.addEvent("showsimilarfeed",function(e){
dom.getElements(_89.selectors.similarButton,dom.id("newsfeed-"+e.id))[0].style.display="none";
});
_89.list=_89.getElement(_89.selectors.list);
_89.loadingDiv=_89.getElements(_89.selectors.loadingDiv);
_89.nomoreDivs=_89.getElements(_89.selectors.nomoreDiv);
_89.loadingDiv.hide();
_89.typeTabs=_89.render(".tab",{type:_36.TabControl,onchange:function(e,tab){
var _a3=tab.selectedEle.getData("id");
_8a.setType(_a3);
_8a.reload();
}});
_89.categoryFilter=_89.render(_89.selectors.categoryFilter,{type:_36.TabControl,onchange:function(e){
var tab=this;
if(dom.getElements("#newsfeed-module-box .feed-header-new").length>0){
var _a6=dom.getElements("a",tab.selectedEle)[0].innerHTML;
dom.getElements("label .text",tab)[0].innerHTML=(_a6=="\u5168\u90e8")?"\u65b0\u9c9c\u4e8b":_a6;
var ftc=dom.getElements("#feedTabCategories")[0],fta=dom.getElements("#feedTabAttention")[0];
if(!ftc.hasClass("s")){
ftc.addClass("s");
}
if(fta.hasClass("s")){
fta.removeClass("s");
}
dom.getElements("#newsfeed-module-box .feed-header-new .setting")[0].style.display="none";
_8a.setType("old");
_8a.setCategory(tab.selectedEle.getData("id"));
}else{
dom.getElements("label",tab)[0].innerHTML=tab.selectedEle.innerHTML;
_8a.setCategory(tab.selectedEle.getData("id"));
}
_8a.reload();
}});
_89.moreButtons=_89.render(".more-feed > a",{onclick:function(e,ele){
e.preventDefault();
_8a.append(_89.itemsPerPage);
}});
_89.markAllReadButtons=_89.render(".mark-all-read > a",{onclick:function(e){
e.preventDefault();
XN.DO.confirm({title:"\u6807\u8bb0\u5df2\u8bfb",message:"\u786e\u5b9a\u5c06\u5168\u90e8\u65b0\u9c9c\u4e8b\u8bbe\u7f6e\u4e3a\u5df2\u8bfb\u5417?",callBack:function(r){
if(r){
_8a.markAllRead();
window.scroll(0,0);
}
}});
}});
_89.settingButtons=_89.render(".feed-setting",{onclick:function(e){
e.preventDefault();
if(XN.app.feedRelation){
XN.app.feedRelation.init();
}else{
XN.loadFiles(["http://s.xnimg.cn/csspro/module/friendSelectorAdvanced.css","http://s.xnimg.cn/jspro/xn.ui.friendSelectorColumn.js","http://s.xnimg.cn/jspro/xn.app.feedRelation.js"],function(){
XN.app.feedRelation.init();
});
}
}});
_89.unreadCountNotify=_89.getElements(".unreads-count");
if(_89.unreadCountNotify.length){
_8a.bindUnreadsCountNotify();
_8a.addEvent("newfeeds",function(e,_af){
if(_af>100){
_89.unreadCountNotify.setHTML("100+");
}else{
_89.unreadCountNotify.setHTML(String(_af));
}
_89.unreadCountNotify.show();
});
}
};
});
});
object.add("xn.feed.minifeed","options, dom, xn.feed",function(_b0,_b1,dom,xn){
this.MinifeedAction=new Class(xn.feed.FeedAction,function(){
Class.mixin(this,_b1.Options);
this.initialize=function(_b4,_b5){
xn.feed.FeedAction.prototype.initialize.call(_b4,_b5);
if(!_b5){
_b5={};
}
_b4.itemsPerPage=10;
_b4.markReadAction="/readMini.do";
_b4.readMoreAction="/moreminifeed.do";
_b4.setOptions(_b5,_b4);
};
this.dataParser=staticmethod(function(r){
r=r.responseText.split("##@L#");
var _b7={html:r[0]};
var tmp=document.createElement("div");
dom.wrap(tmp).setHTML(_b7.html);
return tmp.children;
});
});
this.listen=function(){
var ele=dom.getElements(".feed-module")[0];
if(!ele){
return;
}
var _ba=xn.feed.FeedUI.wrap(ele);
var _bb=new _b0.MinifeedAction(_ba.getOptions());
_bb.execute(_ba);
return _bb;
};
if(this.__name__=="__main__"){
XN.dom.ready(function(){
setTimeout(function(){
window.minifeed=_b0.listen();
},0);
});
}
});
var Nielsen={log:function(_bc,pid){
XN.net.sendStats(this.getUrl(_bc,pid)||"");
},getUrl:function(_be,pid){
var _c0={"600009310":"nikeRun","600003017":"nikeSwear","600009306":"nikeBasket","600005227":"dell","600005213":"reiz"};
var _c1={"nikeRun":{feedImpac:"cg=nike&cc=1&si=nr10/imp",feedClick:"cg=nike&cc=1&si=nr10/click"},"nikeSwear":{feedImpac:"cg=nike&cc=1&si=nsw10/imp",feedClick:"cg=nike&cc=1&si=nsw10/click"},"nikeBasket":{feedImpac:"cg=nike&cc=1&si=nb10/imp",feedClick:"cg=nike&cc=1&si=nb10/click"},"dell":{feedImpac:"cg=dell&cc=1&si=d10/imp",feedClick:"cg=dell&cc=1&si=d10/click"},"reiz":{feedImpac:"cg=reiz&cc=1&si=r10/imp",feedClick:"cg=reiz&cc=1&si=r10/click"}};
var key=_c0[arguments[1]||null];
return key&&_c1[key][_be]?("http://secure-cn.imrworldwide.com/cgi-bin/m?ci=cn-renren2010&"+_c1[key][_be]+"&rnd="+new Date().getTime()):"";
}};
object.execute("xn.feed.minifeed");
function moreFeedPic(_c3,_c4){
var ids=$("morePicFeed"+_c3).innerHTML;
var url="retrieveMorePic.do?i="+ids+"&o="+_c4;
new XN.NET.xmlhttp(url,"",function(r){
var _c8=eval(r.responseText);
var s="";
for(var i=0;i<_c8.length;i++){
s+="<li><a href=\"http://photo."+XN.env.domain+"/getphoto.do?id="+_c8[i].i+"&ref=newsfeed&owner="+_c4+"\" target=\"_blank\">"+"<img width=\"80\" height=\"80\" src=\"http://s.xnimg.cn/a.gif\" style=\"background-image:url("+_c8[i].p+")\" /></a></li>";
}
$("moreThumbnails"+_c3).innerHTML="<ul class=\"thumbnails grid\">"+s+"</ul>";
$("moreThumbnails"+_c3).style.display="block";
},{onError:function(){
s.onError();
}});
}
function showFrdRelation(ids,_cc,e){
if(e.hasClicked){
return;
}
e.hasClicked=true;
var fid=_cc;
new XN.net.xmlhttp({url:"http://www."+XN.env.domain+"/ajaxMinifeedRelations/",data:"ids="+ids,onSuccess:function(r){
var j=XN.json.parse(r.responseText);
var _d1=false;
for(key in j){
if(j[key]=="false"){
var a=$("frd_"+key+"_inFeed_"+fid);
_d1=true;
a.style.display="inline";
}
}
if(_d1){
e.style.display="none";
}else{
e.innerHTML="\u4f60\u4eec\u5df2\u662f\u597d\u53cb";
e.className="";
e.style.cssText="color:#888!important;text-decoration:none!important;cursor:text";
}
}});
}
function showFrdRelationTip(e){
if(!XN.browser.IE6){
return;
}
if(Sizzle(".names-tip",e).length!=0){
var tip=Sizzle(".names-tip",e)[0];
}else{
if(Sizzle(".name-tip",e).length!=0){
var tip=Sizzle(".name-tip",e)[0];
}else{
return;
}
}
tip.style.cssText="display: block; zoom: 1";
}
function hideFrdRelationTip(e){
if(!XN.browser.IE6){
return;
}
if(Sizzle(".names-tip",e).length!=0){
var tip=Sizzle(".names-tip",e)[0];
}else{
if(Sizzle(".name-tip",e).length!=0){
var tip=Sizzle(".name-tip",e)[0];
}else{
return;
}
}
tip.style.cssText="display: none; zoom: 0";
}
window.socialFeedStats=function(_d7){
XN.net.sendStats("http://friend."+XN.env.domain+"/ajaxHomeReconnectStat?"+_d7+"&t="+Math.random());
};
function showNamecard(uid,fid){
var box=$("namecardBox_"+fid);
box.style.cssText="overflow:hidden;";
var _db=$("newsfeed-"+fid);
var ele=Sizzle(".legend > a",_db)[0];
var _dd=ele.innerHTML;
if(_dd.indexOf("\u6536\u8d77")!=-1){
var _de=new XN.effect.Motion("easeOut",400);
_de.onTweening=function(){
box.style.height=this.equation(231,0)+"px";
if(!XN.browser.IE){
box.setOpacity(this.equation(1,0));
}
};
_de.onComplete=function(){
box.style.display="none";
if(_dd=="\u70b9\u51fb\u6536\u8d77"){
ele.innerHTML="\u70b9\u51fb\u67e5\u770b";
}else{
if(_dd=="\u6536\u8d77\u540d\u7247"){
ele.innerHTML="\u67e5\u770b\u540d\u7247";
}
}
};
_de.start();
return;
}
if(_db["hasClickedShowCard"]){
return;
}
_db["hasClickedShowCard"]=true;
if(!box){
return;
}
if(box.innerHTML!=""){
var _df=new XN.effect.Motion("easeIn",400);
box.style.height="0";
_df.onTweening=function(){
box.style.height=this.equation(0,231)+"px";
if(!XN.browser.IE){
box.setOpacity(this.equation(0,1));
}
};
_df.onComplete=function(){
if(_dd=="\u70b9\u51fb\u67e5\u770b"){
ele.innerHTML="\u70b9\u51fb\u6536\u8d77";
}else{
if(_dd=="\u67e5\u770b\u540d\u7247"){
ele.innerHTML="\u6536\u8d77\u540d\u7247";
}
}
_db["hasClickedShowCard"]=false;
};
_df.start();
return;
}
var _e0=$element("div"),_e1=$element("div");
_e0.className="cards-detail";
_e0.style.height="0px";
if(!XN.browser.IE){
_e0.setOpacity(0);
}
_e1.className="card-privacy";
var md=function(s,p){
var ss=s.toString();
var _e6=false;
if(ss==""){
ss="\u672a\u586b\u5199";
}else{
if(ss=="-1"){
if(XN.browser.Gecko){
ss="<img style=\"vertical-align: middle;\" title=\"\u9690\u79c1\u4e0d\u53ef\u89c1\" src=\"http://a.xnimg.cn/imgpro/icons/newlock.png\" />";
}else{
ss="<img style=\"vertical-align: middle;margin-top:5px;\" title=\"\u9690\u79c1\u4e0d\u53ef\u89c1\" src=\"http://a.xnimg.cn/imgpro/icons/newlock.png\" />";
}
_e6=true;
}
}
return [ss,_e6];
};
new XN.net.xmlhttp({url:"http://www.renren.com/minifeedShowcard?friendID="+uid,onSuccess:function(r){
var j=XN.json.parse(r.responseText);
var p=parseInt(j.cardPrivacy);
if(parseInt(uid)==parseInt(XN.user.id)){
p=4;
}
var g="Ta";
if(j.friendGender&&j.friendGender!=""){
if(j.friendGender=="\u7537\u751f"){
g="\u4ed6";
}
if(j.friendGender=="\u5973\u751f"){
g="\u5979";
}
}
var _eb=false;
for(key in j){
if(key!="msn"&&key!="phone"&&key!="qq"&&key!="email"&&key!="address"&&key!="bak"){
continue;
}
var jjk=md(j[key],p);
j[key]=jjk[0];
_eb=jjk[1]||_eb;
}
_e0.innerHTML="<a href=\"#nogo\" onclick=\"this.blur();\" style=\"cursor:default;outline:0 none;\" class=\"float-right\"><img src=\""+j.head+"\" class=\"\" width=\"50\"></a><h2 style=\"*line-height:25px;\">"+j.name+"</h2><dl class=\"info-detail\"><dt>\u624b\u673a\uff1a</dt><dd>"+j.phone+"</dd><dt>QQ\uff1a</dt><dd>"+j.qq+"</dd><dt>MSN\uff1a</dt><dd>"+j.msn+"</dd><dt>\u90ae\u7bb1\uff1a</dt><dd>"+j.email+"</dd><dt>\u5730\u5740\uff1a</dt><dd>"+j.address+"</dd><dt>\u8865\u5145\uff1a</dt><dd>"+j.bak+"</dd></dl>";
if(p==1){
_e1.innerHTML="\u5bf9\u65b9\u53ea\u5bf9\u597d\u53cb\u516c\u5f00\u4e86\u8be6\u60c5\u3002<a href=\"javascript:;\" onclick=\"showRequestFriendDialog('"+uid+"','"+j.name+"','"+j.head+"', '', '');socialFeedStats('from=mf_adbook_apply');return false;\">\u52a0\u4e3a\u597d\u53cb</a>";
box.appendChild(_e1);
}else{
if(p==2){
_e1.innerHTML="\u7531\u4e8e\u5bf9\u65b9\u9690\u79c1\u8bbe\u7f6e\uff0c\u4ea4\u6362\u540d\u7247\u540e\u624d\u80fd\u67e5\u770b\u8be6\u60c5\u3002<a href=\"javascript:;\" onclick=\"socialFeedStats('from=mf_adbook_excard');\">\u7acb\u5373\u4ea4\u6362</a>";
$(Sizzle("a",_e1)[0]).addEvent("click",function(){
new XN.net.xmlhttp({url:"http://friend.renren.com/exchangecard?ids="+uid,onSuccess:function(r){
var j=XN.json.parse(r.responseText);
if(parseInt(j.code)==0){
XN.DO.showMessage("\u4ea4\u6362\u8bf7\u6c42\u5df2\u53d1\u9001");
}else{
XN.DO.showError("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5");
}
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5");
}});
});
box.appendChild(_e1);
}else{
if(_eb){
_e1.innerHTML="\u7531\u4e8e\u5bf9\u65b9\u9690\u79c1\u8bbe\u7f6e\uff0c\u90e8\u5206\u4fe1\u606f\u4e0d\u53ef\u89c1";
box.appendChild(_e1);
}
}
}
box.appendChild(_e0);
var _ef=new XN.effect.Motion("easeIn",400);
_ef.onTweening=function(){
_e0.style.height=this.equation(0,175)+"px";
if(!XN.browser.IE){
_e0.setOpacity(this.equation(0,1));
}
};
_ef.onComplete=function(){
_e0.style.height="175px";
if(_dd=="\u70b9\u51fb\u67e5\u770b"){
ele.innerHTML="\u70b9\u51fb\u6536\u8d77";
}else{
if(_dd=="\u67e5\u770b\u540d\u7247"){
ele.innerHTML="\u6536\u8d77\u540d\u7247";
}
}
_db["hasClickedShowCard"]=false;
};
_ef.start();
socialFeedStats("from=mf_adbook_card");
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5");
_db["hasClickedShowCard"]=false;
}});
}
XN.app.ILikeShowPlayer=function(){
};
XN.app.ILikeShowPlayer.prototype={init:function(){
var _f0=this,_f1=$("newsfeed-module-box"),url="",_f3=480,_f4=360,_f5="";
this.oDialogBodys={};
var _f6;
_f1&&_f1.delegate("a[data-flash-box=true]","click",function(e){
e.preventDefault();
try{
_f6=this.parentNode;
while(_f6.nodeName.toLowerCase()!="article"){
_f6=_f6.parentNode;
if(_f6==document.body){
break;
}
}
}
catch(err){
console.log(err);
}
try{
url=_f6.getAttribute("data-movie-url");
_f3=_f6.getAttribute("data-movie-width");
_f4=_f6.getAttribute("data-movie-height");
_f5=_f6.getAttribute("data-movie-keyset");
_f0.alert(url,_f3,_f4,_f5);
}
catch(err){
throw new Error(err.name+" : "+err);
}
});
},close:function(){
this.iLikeWindow.remove();
this.iLikeWindow=undefined;
},alert:function(url,_f9,_fa,_fb){
var _fc=window.scrollY?window.scrollY:document.documentElement.scrollTop,_fd=document.all?document.getElementsByTagName("html")[0].offsetHeight:window.innerHeight,Y=_fc;
if(_fa<_fd){
Y+=(_fd-_fa)/2;
}
if(!this.iLikeWindow){
this.iLikeWindow=new XN.ui.dialog({width:parseInt(_f9)+22,body:"<div id=\"iLikeMovieHolder\"></div>",modal:true});
this.iLikeWindow.header.hide();
this.iLikeWindow.footer.hide();
this.iLikeWindow.setY(Y);
this.oDialogBodys=Sizzle(".dialog_body");
for(var i=0,len=this.oDialogBodys.length;i<len;i++){
this.oDialogBodys[i].style.padding="0";
this.oDialogBodys[i].style.height=(parseInt(_fa)-1)+"px";
}
}else{
this.iLikeWindow.show();
}
XN.loadFile("http://s.xnimg.cn/jspro/lib/swfobject.js",function(){
swfobject.embedSWF("http://a.xnimg.cn/swf/feed-ilike-player-new.swf","iLikeMovieHolder",_f9,_fa,"9","",{tvURL:url,urlSet:escape(_fb)},{allowscriptaccess:"always",wmode:"window",allowfullscreen:"true",quality:"high"});
});
}};
var iLikePlayerShow=new XN.app.ILikeShowPlayer();
XN.dom.readyDo(function(){
iLikePlayerShow.init();
});
if(XN.browser.IE){
try{
if(window.external.msIsSiteMode()){
window.external.msSiteModeClearIconOverlay();
window.external.msSiteModeClearJumpList();
}
}
catch(e){
}
}
XN.dom.ready(function(){
if(!window.asyncHTMLManager||!$("newsfeed-module-box")){
return;
}
var _101=Sizzle("#newsfeed-module-box .feed-list")[0],_102=Sizzle(".a-feed",_101)[0],tip=Sizzle(".new-feed-tip",_101)[0];
if(!_101||!_102){
return;
}
var _104=$("newFeedsCount"),btn=Sizzle(".show-new-feed",_101)[0],_106=Sizzle(".show-new-feed-loading",_101)[0];
var _107=function(){
var _108=function(_109){
_102=Sizzle(".a-feed",_101)[0];
_101.insertBefore(_109,_102);
XN.element.eval_inner_JS(_109);
};
var _10a=function(){
btn.style.display="none";
_106.style.display="block";
};
var _10b=function(){
tip.style.display="none";
_104.innerHTML="0";
btn.setAttribute("data-fids","");
};
var _10c=function(){
_106.style.display="none";
btn.style.display="block";
tip.style.display="block";
};
var _10d=function(){
return btn.getAttribute("data-fids");
};
var _10e=function(){
tip=Sizzle(".new-feed-tip",_101)[0];
if(!tip){
var tmp=$element("div");
tmp.innerHTML="<div style=\"display:none;\" class=\"new-feed-tip\"> <a data-fids=\"\" class=\"show-new-feed\" onclick=\"return false;\" href=\"#\">\u6709<span id=\"newFeedsCount\">0</span>\u6761\u65b0\u9c9c\u4e8b\uff0c\u70b9\u51fb\u663e\u793a</a> <span style=\"display:none\" class=\"show-new-feed-loading\">\u65b0\u9c9c\u4e8b\u8bfb\u53d6\u4e2d...</span> </div>";
tip=Sizzle(".new-feed-tip",tmp)[0];
_102=Sizzle(".a-feed",_101)[0];
_101.insertBefore(tip,_102);
_104=$("newFeedsCount");
btn=Sizzle(".show-new-feed",_101)[0];
_106=Sizzle(".show-new-feed-loading",_101)[0];
_110();
}
if(!_104){
return;
}
var ct=parseInt(_104.innerHTML);
_104.innerHTML=(ct>=99?"99+":ct+1);
if(XN.browser.IE){
try{
if(window.external.msIsSiteMode()){
var i=parseInt(_104.innerHTML)>9?"9+":_104.innerHTML;
window.external.msSiteModeClearIconOverlay();
window.external.msSiteModeSetIconOverlay("http://a.xnimg.cn/imgpro/icons/"+i+".ico","\u65b0\u589e"+_104.innerHTML+"\u6761\u65b0\u9c9c\u4e8b");
window.external.msSiteModeClearJumpList();
window.external.msSiteModeCreateJumpList("\u63d0\u9192");
window.external.msSiteModeAddJumpListItem("\u65b0\u589e"+_104.innerHTML+"\u6761\u65b0\u9c9c\u4e8b","http://www.renren.com/","http://a.xnimg.cn/n/res/icons/newsfeed.ico","self");
window.external.msSiteModeActivate();
}
}
catch(e){
}
}
_10c();
};
var _110=function(){
if(btn){
XN.event.addEvent(btn,"click",function(){
_113();
if(XN.browser.IE){
try{
if(window.external.msIsSiteMode()){
window.external.msSiteModeClearJumpList();
window.external.msSiteModeClearIconOverlay();
}
}
catch(e){
}
}
});
}
};
var _113=function(){
var _114=_10d().split(",").length;
if(_114>20){
window.newsfeed.reload();
return;
}
_10a();
new XN.net.xmlhttp({url:"http://www.renren.com/retrievefeedid.do?ref=notifyfeed",data:"id="+_10d(),onSuccess:function(r){
var tmp=$element("div");
if(XN.browser.IE){
tmp.style.display="none";
document.body.appendChild(tmp);
}
tmp.innerHTML=r.responseText;
var _117=Sizzle(".a-feed",tmp);
_117[0].style.cssText="border-bottom-width:3px;";
for(var i=0;i<_117.length;i++){
_108(_117[i]);
}
_10b();
if(XN.browser.IE){
tmp.remove();
}
}});
if(COMSCORE){
COMSCORE.beacon({c1:2,c2:6934070,c3:"",c4:"",c5:"",c6:"",c15:""});
}
};
var _119=function(fid){
if(!$("newsfeed-module-box")){
return;
}
_10e();
var fids=_10d();
btn.setAttribute("data-fids",(fids+(fids==""?"":",")+fid));
};
webpager.addEvent("other_got",function(r){
if(!window.asyncHTMLManager||!$("newsfeed-module-box")){
return;
}
try{
if(r.mtype.indexOf("feed_")==0&&(!window.newsfeed.currentType||window.newsfeed.currentType.id=="old")&&(!window.newsfeed.currentCategory||window.newsfeed.currentCategory.id==-1)&&(!XN.cookie.get("feedType")||XN.cookie.get("feedType").split("_")[1]!="live")){
_119(XN.json.parse(r.content).feed_id);
}
}
catch(e){
}
});
_110();
};
if(!XN.webpager){
if(!XN.webpagerUIReadyQ){
XN.webpagerUIReadyQ=[];
}
XN.webpagerUIReadyQ.push(_107);
}else{
_107();
}
});
window.rrmusicboxoption={width:620,height:565,left:200,top:0,url:"box"};
function music_openRRMCPop(_11d,opt){
document.domain=XN.env.domain;
var _11f="toolbar=no,location=no,directories=no,menubar=no,resizable=yes,status=yes,scrollbars=no,width="+rrmusicboxoption.width+",height="+rrmusicboxoption.height+",left="+rrmusicboxoption.left+",top="+rrmusicboxoption.top,_120=window.open("http://a.xnimg.cn/xnapp/music/res/blank.htm","rrMCWin",_11f);
if(_120){
_120.focus();
}else{
alert("\u4f60\u7684\u6d4f\u89c8\u5668\u62e6\u622a\u4e86\u64ad\u653e\u5668\u7a97\u53e3,\u8bf7\u8bbe\u7f6e!");
return false;
}
var _121={url:"http://music."+XN.env.domain+"/playlist/add"};
if(opt){
$extend(_121,opt);
}
music_postRequest(_121.url,_11d,"rrMCWin");
}
function music_postRequest(url,_123,_124){
try{
var _d=document;
var f=_d.createElement("form");
f.action=url;
f.method="post";
for(var item in _123){
if(_123[item] instanceof Array){
for(var iaa=0;iaa<_123[item].length;iaa++){
var io=_d.createElement("input");
io.type="hidden";
io.name=escape(item);
io.value=escape(_123[item][iaa]);
f.appendChild(io);
}
}else{
var io=_d.createElement("input");
io.type="hidden";
io.name=escape(item);
io.value=escape(_123[item]);
f.appendChild(io);
}
}
if(_124){
f.target=_124;
}
var _12a=_d.createElement("input");
_12a.type="hidden";
_12a.name="redirectType";
_12a.value=rrmusicboxoption.url=="musicbox"?"old":"new";
f.appendChild(_12a);
var rtk=_d.createElement("input");
rtk.type="hidden";
rtk.name="_rtk";
rtk.value=XN.get_check_x;
f.appendChild(rtk);
_d.body.appendChild(f);
f.submit();
}
catch(e){
}
}
function music_playSong(ids){
var _12d={type:"song",id:[ids]};
var opt={url:"http://music."+XN.env.domain+"/playlist/add?from=renrenHome"};
music_openRRMCPop(_12d,opt);
}
function music_playAlbum(ids){
var _130={type:"album",id:[ids]};
var opt={url:"http://music."+XN.env.domain+"/playlist/add?from=renrenHome"};
music_openRRMCPop(_130,opt);
}
function music_playSongBook(ids){
var _133={type:"songbook",id:[ids]};
var opt={url:"http://music."+XN.env.domain+"/playlist/add?from=renrenHome"};
music_openRRMCPop(_133,opt);
}
function imageOnLoad(img){
if(img.height>=300){
img.parentNode.className="bigPic";
}
}
window.playFeedAudio=function(el,t,file){
el=$("newsfeed-"+el);
var wrap=$element("div");
wrap.className="media-player";
if(t=="mp3"){
wrap.innerHTML=XN.Template.flashPlayer({filename:file});
}else{
wrap.innerHTML=XN.Template.mediaPlayer({filename:file});
}
el.addClass("playing");
var pos=XN.DOM.getElementsByClassName("audio",el)[0];
pos.parentNode.insertBefore(wrap,pos.nextSibling);
};
window.playFeedVideo=function(_13b,_13c,_13d,_13e){
_13e=_13e||1.2;
var url="http://share."+XN.env.domain+"/share/share.do";
var el=$("newsfeed-"+_13c);
var wrap=$element("div");
wrap.className="media-player";
el.addClass("playing");
var pos=XN.DOM.getElementsByClassName("video",el)[0];
pos.style.display="none";
pos.parentNode.insertBefore(wrap,pos.nextSibling);
function playswf(file,_144,_145,name,_147,_148){
wrap.setStyle("height:auto;");
var w,h;
w=el.offsetWidth-24;
if(w>450){
w=location.href.indexOf("Home.do")!=-1?450:420;
}
h=parseInt(w/_144);
wrap.innerHTML=XN.Template.flash({width:w,height:h,filename:file});
function updateOuterShareTip(){
function copyShareUrl(){
if(window.clipboardData.setData("Text",$("shareLinkVal").value)){
$("copyTip").innerHTML="(\u94fe\u63a5\u5df2\u590d\u5236)";
}else{
$("shareLinkVal").select();
$("copyTip").innerHTML="(\u8bf7\u624b\u52a8\u590d\u5236)";
}
}
var _14b=$("copyTip");
if(!_14b||!$("shareLinkVal")){
return;
}
if(window.clipboardData){
$("shareLinkVal").style.width="210px";
_14b.innerHTML="<a href=\"javascript:;\" style=\"margin-left:5px;\">\u590d\u5236</a>";
_14b.getElementsByTagName("a")[0].onclick=copyShareUrl;
}else{
_14b.innerHTML="(Ctrl+C\u6216\u53f3\u952e\u590d\u5236)";
}
_14b.show();
}
updateOuterShareTip();
}
new XN.NET.xmlhttp({"url":url,data:"id="+_13b+"&owner="+_13d,onSuccess:function(r){
try{
var ret=XN.JSON.parse(r.responseText);
var _14e=ret.status;
if(_14e==0){
playurl=ret.playUrl;
if(playurl!=""){
playswf(playurl,_13e,ret.owner,ret.name,ret.shareCount,ret.viewCount);
}
}else{
if(_14e==1){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");
return;
}
}
}
catch(e){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");
}
},onError:function(){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664");
}});
};
window.playFlyerVideo=function(url,_150,_151){
var el=$(_150);
var wrap=XN.DOM.getElementsByClassName("media-player",el)[0];
el.addClass("playing");
playswf(url,_151);
wrap.style.display="block";
function playswf(file,_155){
var w,h;
w=el.offsetWidth-24;
if(w>450){
w=location.href.indexOf("Home.do")!=-1?450:420;
}
h=parseInt(w/_155);
wrap.innerHTML=XN.Template.flash({width:w,height:h,filename:file});
}
};
window.play=function(el,t,file){
el=$(el+"");
if(t=="mp3"){
el.innerHTML=XN.Template.flashPlayer({filename:file});
}else{
el.innerHTML=XN.Template.mediaPlayer({filename:file});
}
};
window.playswf=function(el,file,_15d){
var w,h;
el=$(el+"");
w=el.parentNode.offsetWidth-24;
if(w>450){
w=450;
}
h=parseInt(w/_15d);
el.innerHTML=XN.Template.flash({width:w,height:h,filename:file});
el.onclick=null;
};
newsfeed_play_video=function(id,file,_162){
XN.loadFile("http://s.xnimg.cn/jspro/lib/mediaplayer.js",function(){
if(!isSafeVideo(file)){
XN.DO.alert("\u65e0\u6548\u7684\u89c6\u9891\u5730\u5740");
XN.log("\u65e0\u6548\u89c6\u9891\u5730\u5740:"+file);
return;
}
var vdiv=$(id).findFirstClass("player");
$(id).findFirstClass("video-play").show();
w=vdiv.parentNode.offsetWidth;
if(w>450){
w=location.href.indexOf("Home.do")!=-1?450:420;
}
var h=parseInt(w/_162);
vdiv.innerHTML="<div>"+XN.Template.flash({width:w,height:h,filename:file})+"</div>";
$(id).findFirstClass("video").hide();
$(id).findFirstClass("content").hide();
$(id).findFirstClass("legend").hide();
var cm=$(id).findFirstClass("comment");
if(cm){
cm.hide();
}
});
};
newsfeed_close_video=function(id){
var el=$(id);
var t=el.findFirstClass("timer");
if(el.timer){
clearInterval(el.timer);
el.timer=null;
t.innerHTML=5;
}
el.findFirstClass("player").clear();
el.findFirstClass("share-loading").hide();
el.findFirstClass("share-button").show();
el.findFirstClass("video-play").hide();
el.findFirstClass("v-share-tips").show();
el.findFirstClass("video").show();
el.findFirstClass("legend").show();
el.findFirstClass("content").show();
var cm=el.findFirstClass("comment");
if(cm){
cm.show();
}
var s=4;
el.timer=setInterval(function(){
if(s<=0){
clearInterval(el.timer);
el.timer=null;
el.findFirstClass("v-share-tips").hide();
t.innerHTML=5;
return;
}
t.innerHTML=s;
s--;
},1000);
};
newsfeed_share_video=function(id,_16c,_16d){
$(id).findFirstClass("share-button").hide();
var _16e=$(id).findFirstClass("share-loading");
_16e.show();
new XN.net.xmlhttp({url:"http://share."+XN.env.domain+"/share/accolade.do",data:XN.array.toQueryString({id:_16c,owner:_16d}),onComplete:function(){
_16e.hide();
},onSuccess:function(){
var tip=$(id).findFirstClass("tip-success");
tip.show().hide("delay");
},onError:function(){
XN.DO.alert("\u7f51\u7edc\u539f\u56e0,\u5206\u4eab\u5931\u8d25");
}});
};
function moreFeedPic(_170,_171){
var ids=$("morePicFeed"+_170).innerHTML;
var url="retrieveMorePic.do?i="+ids+"&o="+_171;
new XN.NET.xmlhttp(url,"",function(r){
var _175=eval(r.responseText);
var s="";
for(var i=0;i<_175.length;i++){
s+="<li><a href=\"http://photo."+XN.env.domain+"/getphoto.do?id="+_175[i].i+"&ref=newsfeed&owner="+_171+"\" target=\"_blank\">"+"<img width=\"80\" height=\"80\" src=\"http://s.xnimg.cn/a.gif\" style=\"background-image:url("+_175[i].p+")\" /></a></li>";
}
$("moreThumbnails"+_170).innerHTML="<ul class=\"thumbnails grid\">"+s+"</ul>";
$("moreThumbnails"+_170).style.display="block";
},{onError:function(){
s.onError();
}});
}
window.preplayswf=function(id,_179,elem,_17b){
var url="http://share."+XN.env.domain+"/share/share.do";
if(elem&&_17b){
$(id+"").setStyle("background-image:url("+XN.ENV.staticRoot+"img/upload_progress.gif);float:none;margin-bottom:10px;");
}
new XN.NET.xmlhttp({"url":url,data:"id="+id+"&owner="+_179,onSuccess:function(r){
try{
var ret=XN.JSON.parse(r.responseText);
var _17f=ret.status;
if(_17f==0){
playurl=ret.playUrl;
if(playurl!=""){
playswf(elem,playurl,_17b);
}
}else{
if(_17f==1){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664!");
return;
}
}
}
catch(e){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664!");
}
},onError:function(){
XN.DO.showError("\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u5220\u9664!");
}});
};
var SiteFeedRec=function(_180){
this.init(_180);
};
SiteFeedRec.prototype={init:function(_181){
this.box=Sizzle("#newsfeed-"+_181+" .site-list")[0];
this.current=0;
this.bindEvents();
},bindEvents:function(){
var that=this;
var _183=Sizzle(".new-site-btn",that.box.parentNode)[0];
this.bindLiEvent();
XN.event.addEvent(_183,"click",function(e){
XN.event.stop(e||window.event);
that.box.style.height="auto";
_183.style.display="none";
});
},bindLiEvent:function(){
var li=Sizzle("li",this.box);
for(var i=this.current;i<li.length;i++){
var el=$(li[i]);
this.current++;
this.hoverLi(el);
this.bindFollow(el);
}
},bindFollow:function(el){
var _189=Sizzle(".site-btn a",el)[0];
var that=this;
XN.event.addEvent(_189,"click",function(e){
XN.event.stop(e||event);
var uri=_189.getAttribute("data-uri");
if(uri==""){
return;
}
var _18d=_189.getAttribute("requesting");
if(_18d==true){
return;
}
_189.setAttribute("requesting","true");
that.followAction(uri,function(){
el.setAttribute("followed","true");
_189.setAttribute("requesting","false");
$(Sizzle(".site-btn",el)[0]).hide();
});
});
},hoverLi:function(el){
XN.event.addEvent(el,"mouseover",function(e){
var _190=XN.event.element(e);
while(_190.nodeName.toLowerCase()!="li"){
_190=_190.parentNode;
}
if(el.getAttribute("followed")=="true"){
Sizzle(".site-btn-followed",el)[0].style.visibility="visible";
Sizzle(".site-btn-followed",el)[0].style.display="block";
}else{
Sizzle(".site-btn",el)[0].style.visibility="visible";
Sizzle(".site-btn",el)[0].style.display="block";
}
});
XN.event.addEvent(el,"mouseout",function(e){
var _192=XN.event.element(e);
while(_192.nodeName.toLowerCase()!="li"){
_192=_192.parentNode;
}
if(el.getAttribute("followed")=="true"){
Sizzle(".site-btn-followed",el)[0].style.visibility="hidden";
Sizzle(".site-btn-followed",el)[0].style.display="none";
}else{
Sizzle(".site-btn",el)[0].style.visibility="hidden";
Sizzle(".site-btn",el)[0].style.display="none";
}
});
},followAction:function(uri,cb){
new XN.net.xmlhttp({url:"http://zhan.renren.com/"+uri+"/followfeed",method:"post",onSuccess:function(r){
var ret=XN.json.parse(r.responseText);
if(ret.code==0){
if(cb){
cb();
}
}else{
alert(ret.msg||"\u670d\u52a1\u5668\u7e41\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01");
}
}});
}};
XN.event.enableCustomEvent(SiteFeedRec.prototype);
window.SiteFeedRec=SiteFeedRec;
var SWFUpload;
if(SWFUpload==undefined){
SWFUpload=function(_197){
this.initSWFUpload(_197);
};
}
SWFUpload.prototype.initSWFUpload=function(_198){
try{
this.customSettings={};
this.settings=_198;
this.eventQueue=[];
this.movieName="SWFUpload_"+SWFUpload.movieCount++;
this.movieElement=null;
SWFUpload.instances[this.movieName]=this;
this.initSettings();
this.loadFlash();
this.displayDebugInfo();
}
catch(ex){
delete SWFUpload.instances[this.movieName];
throw ex;
}
};
SWFUpload.instances={};
SWFUpload.movieCount=0;
SWFUpload.version="2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};
SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};
SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};
SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};
SWFUpload.CURSOR={ARROW:-1,HAND:-2};
SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};
SWFUpload.completeURL=function(url){
if(typeof (url)!=="string"||url.match(/^https?:\/\//i)||url.match(/^\//)){
return url;
}
var _19a=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");
var _19b=window.location.pathname.lastIndexOf("/");
if(_19b<=0){
path="/";
}else{
path=window.location.pathname.substr(0,_19b)+"/";
}
return path+url;
};
SWFUpload.prototype.initSettings=function(){
this.ensureDefault=function(_19c,_19d){
this.settings[_19c]=(this.settings[_19c]==undefined)?_19d:this.settings[_19c];
};
this.ensureDefault("upload_url","");
this.ensureDefault("preserve_relative_urls",false);
this.ensureDefault("file_post_name","Filedata");
this.ensureDefault("post_params",{});
this.ensureDefault("use_query_string",false);
this.ensureDefault("requeue_on_error",false);
this.ensureDefault("http_success",[]);
this.ensureDefault("assume_success_timeout",0);
this.ensureDefault("file_types","*.*");
this.ensureDefault("file_types_description","All Files");
this.ensureDefault("file_size_limit",0);
this.ensureDefault("file_upload_limit",0);
this.ensureDefault("file_queue_limit",0);
this.ensureDefault("flash_url","swfupload.swf");
this.ensureDefault("prevent_swf_caching",true);
this.ensureDefault("button_image_url","");
this.ensureDefault("button_width",1);
this.ensureDefault("button_height",1);
this.ensureDefault("button_text","");
this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");
this.ensureDefault("button_text_top_padding",0);
this.ensureDefault("button_text_left_padding",0);
this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);
this.ensureDefault("button_disabled",false);
this.ensureDefault("button_placeholder_id","");
this.ensureDefault("button_placeholder",null);
this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);
this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);
this.ensureDefault("debug",false);
this.settings.debug_enabled=this.settings.debug;
this.settings.return_upload_start_handler=this.returnUploadStart;
this.ensureDefault("swfupload_loaded_handler",null);
this.ensureDefault("file_dialog_start_handler",null);
this.ensureDefault("file_queued_handler",null);
this.ensureDefault("file_queue_error_handler",null);
this.ensureDefault("file_dialog_complete_handler",null);
this.ensureDefault("upload_start_handler",null);
this.ensureDefault("upload_progress_handler",null);
this.ensureDefault("upload_error_handler",null);
this.ensureDefault("upload_success_handler",null);
this.ensureDefault("upload_complete_handler",null);
this.ensureDefault("debug_handler",this.debugMessage);
this.ensureDefault("custom_settings",{});
this.customSettings=this.settings.custom_settings;
if(!!this.settings.prevent_swf_caching){
this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime();
}
if(!this.settings.preserve_relative_urls){
this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);
this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url);
}
delete this.ensureDefault;
};
SWFUpload.prototype.loadFlash=function(){
var _19e,_19f;
if(document.getElementById(this.movieName)!==null){
throw "ID "+this.movieName+" is already in use. The Flash Object could not be added";
}
_19e=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;
if(_19e==undefined){
throw "Could not find the placeholder element: "+this.settings.button_placeholder_id;
}
_19f=document.createElement("div");
_19f.innerHTML=this.getFlashHTML();
_19e.parentNode.replaceChild(_19f.firstChild,_19e);
if(window[this.movieName]==undefined){
window[this.movieName]=this.getMovieElement();
}
};
SWFUpload.prototype.getFlashHTML=function(){
return ["<object id=\"",this.movieName,"\" type=\"application/x-shockwave-flash\" data=\"",this.settings.flash_url,"\" width=\"",this.settings.button_width,"\" height=\"",this.settings.button_height,"\" class=\"swfupload\">","<param name=\"wmode\" value=\"",this.settings.button_window_mode,"\" />","<param name=\"movie\" value=\"",this.settings.flash_url,"\" />","<param name=\"quality\" value=\"high\" />","<param name=\"menu\" value=\"false\" />","<param name=\"allowScriptAccess\" value=\"always\" />","<param name=\"flashvars\" value=\""+this.getFlashVars()+"\" />","</object>"].join("");
};
SWFUpload.prototype.getFlashVars=function(){
var _1a0=this.buildParamString();
var _1a1=this.settings.http_success.join(",");
return ["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(_1a1),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(_1a0),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("");
};
SWFUpload.prototype.getMovieElement=function(){
if(this.movieElement==undefined){
this.movieElement=document.getElementById(this.movieName);
}
if(this.movieElement===null){
throw "Could not find Flash element";
}
return this.movieElement;
};
SWFUpload.prototype.buildParamString=function(){
var _1a2=this.settings.post_params;
var _1a3=[];
if(typeof (_1a2)==="object"){
for(var name in _1a2){
if(_1a2.hasOwnProperty(name)){
_1a3.push(encodeURIComponent(name.toString())+"="+encodeURIComponent(_1a2[name].toString()));
}
}
}
return _1a3.join("&amp;");
};
SWFUpload.prototype.destroy=function(){
try{
this.cancelUpload(null,false);
var _1a5=null;
_1a5=this.getMovieElement();
if(_1a5&&typeof (_1a5.CallFunction)==="unknown"){
for(var i in _1a5){
try{
if(typeof (_1a5[i])==="function"){
_1a5[i]=null;
}
}
catch(ex1){
}
}
try{
_1a5.parentNode.removeChild(_1a5);
}
catch(ex){
}
}
window[this.movieName]=null;
SWFUpload.instances[this.movieName]=null;
delete SWFUpload.instances[this.movieName];
this.movieElement=null;
this.settings=null;
this.customSettings=null;
this.eventQueue=null;
this.movieName=null;
return true;
}
catch(ex2){
return false;
}
};
SWFUpload.prototype.displayDebugInfo=function(){
this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""));
};
SWFUpload.prototype.addSetting=function(name,_1a8,_1a9){
if(_1a8==undefined){
return (this.settings[name]=_1a9);
}else{
return (this.settings[name]=_1a8);
}
};
SWFUpload.prototype.getSetting=function(name){
if(this.settings[name]!=undefined){
return this.settings[name];
}
return "";
};
SWFUpload.prototype.callFlash=function(_1ab,_1ac){
_1ac=_1ac||[];
var _1ad=this.getMovieElement();
var _1ae,_1af;
try{
_1af=_1ad.CallFunction("<invoke name=\""+_1ab+"\" returntype=\"javascript\">"+__flash__argumentsToXML(_1ac,0)+"</invoke>");
_1ae=eval(_1af);
}
catch(ex){
throw "Call to "+_1ab+" failed";
}
if(_1ae!=undefined&&typeof _1ae.post==="object"){
_1ae=this.unescapeFilePostParams(_1ae);
}
return _1ae;
};
SWFUpload.prototype.selectFile=function(){
this.callFlash("SelectFile");
};
SWFUpload.prototype.selectFiles=function(){
this.callFlash("SelectFiles");
};
SWFUpload.prototype.startUpload=function(_1b0){
this.callFlash("StartUpload",[_1b0]);
};
SWFUpload.prototype.cancelUpload=function(_1b1,_1b2){
if(_1b2!==false){
_1b2=true;
}
this.callFlash("CancelUpload",[_1b1,_1b2]);
};
SWFUpload.prototype.stopUpload=function(){
this.callFlash("StopUpload");
};
SWFUpload.prototype.getStats=function(){
return this.callFlash("GetStats");
};
SWFUpload.prototype.setStats=function(_1b3){
this.callFlash("SetStats",[_1b3]);
};
SWFUpload.prototype.getFile=function(_1b4){
if(typeof (_1b4)==="number"){
return this.callFlash("GetFileByIndex",[_1b4]);
}else{
return this.callFlash("GetFile",[_1b4]);
}
};
SWFUpload.prototype.addFileParam=function(_1b5,name,_1b7){
return this.callFlash("AddFileParam",[_1b5,name,_1b7]);
};
SWFUpload.prototype.removeFileParam=function(_1b8,name){
this.callFlash("RemoveFileParam",[_1b8,name]);
};
SWFUpload.prototype.setUploadURL=function(url){
this.settings.upload_url=url.toString();
this.callFlash("SetUploadURL",[url]);
};
SWFUpload.prototype.setPostParams=function(_1bb){
this.settings.post_params=_1bb;
this.callFlash("SetPostParams",[_1bb]);
};
SWFUpload.prototype.addPostParam=function(name,_1bd){
this.settings.post_params[name]=_1bd;
this.callFlash("SetPostParams",[this.settings.post_params]);
};
SWFUpload.prototype.removePostParam=function(name){
delete this.settings.post_params[name];
this.callFlash("SetPostParams",[this.settings.post_params]);
};
SWFUpload.prototype.setFileTypes=function(_1bf,_1c0){
this.settings.file_types=_1bf;
this.settings.file_types_description=_1c0;
this.callFlash("SetFileTypes",[_1bf,_1c0]);
};
SWFUpload.prototype.setFileSizeLimit=function(_1c1){
this.settings.file_size_limit=_1c1;
this.callFlash("SetFileSizeLimit",[_1c1]);
};
SWFUpload.prototype.setFileUploadLimit=function(_1c2){
this.settings.file_upload_limit=_1c2;
this.callFlash("SetFileUploadLimit",[_1c2]);
};
SWFUpload.prototype.setFileQueueLimit=function(_1c3){
this.settings.file_queue_limit=_1c3;
this.callFlash("SetFileQueueLimit",[_1c3]);
};
SWFUpload.prototype.setFilePostName=function(_1c4){
this.settings.file_post_name=_1c4;
this.callFlash("SetFilePostName",[_1c4]);
};
SWFUpload.prototype.setUseQueryString=function(_1c5){
this.settings.use_query_string=_1c5;
this.callFlash("SetUseQueryString",[_1c5]);
};
SWFUpload.prototype.setRequeueOnError=function(_1c6){
this.settings.requeue_on_error=_1c6;
this.callFlash("SetRequeueOnError",[_1c6]);
};
SWFUpload.prototype.setHTTPSuccess=function(_1c7){
if(typeof _1c7==="string"){
_1c7=_1c7.replace(" ","").split(",");
}
this.settings.http_success=_1c7;
this.callFlash("SetHTTPSuccess",[_1c7]);
};
SWFUpload.prototype.setAssumeSuccessTimeout=function(_1c8){
this.settings.assume_success_timeout=_1c8;
this.callFlash("SetAssumeSuccessTimeout",[_1c8]);
};
SWFUpload.prototype.setDebugEnabled=function(_1c9){
this.settings.debug_enabled=_1c9;
this.callFlash("SetDebugEnabled",[_1c9]);
};
SWFUpload.prototype.setButtonImageURL=function(_1ca){
if(_1ca==undefined){
_1ca="";
}
this.settings.button_image_url=_1ca;
this.callFlash("SetButtonImageURL",[_1ca]);
};
SWFUpload.prototype.setButtonDimensions=function(_1cb,_1cc){
this.settings.button_width=_1cb;
this.settings.button_height=_1cc;
var _1cd=this.getMovieElement();
if(_1cd!=undefined){
_1cd.style.width=_1cb+"px";
_1cd.style.height=_1cc+"px";
}
this.callFlash("SetButtonDimensions",[_1cb,_1cc]);
};
SWFUpload.prototype.setButtonText=function(html){
this.settings.button_text=html;
this.callFlash("SetButtonText",[html]);
};
SWFUpload.prototype.setButtonTextPadding=function(left,top){
this.settings.button_text_top_padding=top;
this.settings.button_text_left_padding=left;
this.callFlash("SetButtonTextPadding",[left,top]);
};
SWFUpload.prototype.setButtonTextStyle=function(css){
this.settings.button_text_style=css;
this.callFlash("SetButtonTextStyle",[css]);
};
SWFUpload.prototype.setButtonDisabled=function(_1d2){
this.settings.button_disabled=_1d2;
this.callFlash("SetButtonDisabled",[_1d2]);
};
SWFUpload.prototype.setButtonAction=function(_1d3){
this.settings.button_action=_1d3;
this.callFlash("SetButtonAction",[_1d3]);
};
SWFUpload.prototype.setButtonCursor=function(_1d4){
this.settings.button_cursor=_1d4;
this.callFlash("SetButtonCursor",[_1d4]);
};
SWFUpload.prototype.queueEvent=function(_1d5,_1d6){
if(_1d6==undefined){
_1d6=[];
}else{
if(!(_1d6 instanceof Array)){
_1d6=[_1d6];
}
}
var self=this;
if(typeof this.settings[_1d5]==="function"){
this.eventQueue.push(function(){
this.settings[_1d5].apply(this,_1d6);
});
setTimeout(function(){
self.executeNextEvent();
},0);
}else{
if(this.settings[_1d5]!==null){
throw "Event handler "+_1d5+" is unknown or is not a function";
}
}
};
SWFUpload.prototype.executeNextEvent=function(){
var f=this.eventQueue?this.eventQueue.shift():null;
if(typeof (f)==="function"){
f.apply(this);
}
};
SWFUpload.prototype.unescapeFilePostParams=function(file){
var reg=/[$]([0-9a-f]{4})/i;
var _1db={};
var uk;
if(file!=undefined){
for(var k in file.post){
if(file.post.hasOwnProperty(k)){
uk=k;
var _1de;
while((_1de=reg.exec(uk))!==null){
uk=uk.replace(_1de[0],String.fromCharCode(parseInt("0x"+_1de[1],16)));
}
_1db[uk]=file.post[k];
}
}
file.post=_1db;
}
return file;
};
SWFUpload.prototype.testExternalInterface=function(){
try{
return this.callFlash("TestExternalInterface");
}
catch(ex){
return false;
}
};
SWFUpload.prototype.flashReady=function(){
var _1df=this.getMovieElement();
if(!_1df){
this.debug("Flash called back ready but the flash movie can't be found.");
return;
}
this.cleanUp(_1df);
this.queueEvent("swfupload_loaded_handler");
};
SWFUpload.prototype.cleanUp=function(_1e0){
try{
if(this.movieElement&&typeof (_1e0.CallFunction)==="unknown"){
this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
for(var key in _1e0){
try{
if(typeof (_1e0[key])==="function"){
_1e0[key]=null;
}
}
catch(ex){
}
}
}
}
catch(ex1){
}
window["__flash__removeCallback"]=function(_1e2,name){
try{
if(_1e2){
_1e2[name]=null;
}
}
catch(flashEx){
}
};
};
SWFUpload.prototype.fileDialogStart=function(){
this.queueEvent("file_dialog_start_handler");
};
SWFUpload.prototype.fileQueued=function(file){
file=this.unescapeFilePostParams(file);
this.queueEvent("file_queued_handler",file);
};
SWFUpload.prototype.fileQueueError=function(file,_1e6,_1e7){
file=this.unescapeFilePostParams(file);
this.queueEvent("file_queue_error_handler",[file,_1e6,_1e7]);
};
SWFUpload.prototype.fileDialogComplete=function(_1e8,_1e9,_1ea){
this.queueEvent("file_dialog_complete_handler",[_1e8,_1e9,_1ea]);
};
SWFUpload.prototype.uploadStart=function(file){
file=this.unescapeFilePostParams(file);
this.queueEvent("return_upload_start_handler",file);
};
SWFUpload.prototype.returnUploadStart=function(file){
var _1ed;
if(typeof this.settings.upload_start_handler==="function"){
file=this.unescapeFilePostParams(file);
_1ed=this.settings.upload_start_handler.call(this,file);
}else{
if(this.settings.upload_start_handler!=undefined){
throw "upload_start_handler must be a function";
}
}
if(_1ed===undefined){
_1ed=true;
}
_1ed=!!_1ed;
this.callFlash("ReturnUploadStart",[_1ed]);
};
SWFUpload.prototype.uploadProgress=function(file,_1ef,_1f0){
file=this.unescapeFilePostParams(file);
this.queueEvent("upload_progress_handler",[file,_1ef,_1f0]);
};
SWFUpload.prototype.uploadError=function(file,_1f2,_1f3){
file=this.unescapeFilePostParams(file);
this.queueEvent("upload_error_handler",[file,_1f2,_1f3]);
};
SWFUpload.prototype.uploadSuccess=function(file,_1f5,_1f6){
file=this.unescapeFilePostParams(file);
this.queueEvent("upload_success_handler",[file,_1f5,_1f6]);
};
SWFUpload.prototype.uploadComplete=function(file){
file=this.unescapeFilePostParams(file);
this.queueEvent("upload_complete_handler",file);
};
SWFUpload.prototype.debug=function(_1f8){
this.queueEvent("debug_handler",_1f8);
};
SWFUpload.prototype.debugMessage=function(_1f9){
if(this.settings.debug){
var _1fa,_1fb=[];
if(typeof _1f9==="object"&&typeof _1f9.name==="string"&&typeof _1f9.message==="string"){
for(var key in _1f9){
if(_1f9.hasOwnProperty(key)){
_1fb.push(key+": "+_1f9[key]);
}
}
_1fa=_1fb.join("\n")||"";
_1fb=_1fa.split("\n");
_1fa="EXCEPTION: "+_1fb.join("\nEXCEPTION: ");
SWFUpload.Console.writeLine(_1fa);
}else{
SWFUpload.Console.writeLine(_1f9);
}
}
};
SWFUpload.Console={};
SWFUpload.Console.writeLine=function(_1fd){
var _1fe,_1ff;
try{
_1fe=document.getElementById("SWFUpload_Console");
if(!_1fe){
_1ff=document.createElement("form");
document.getElementsByTagName("body")[0].appendChild(_1ff);
_1fe=document.createElement("textarea");
_1fe.id="SWFUpload_Console";
_1fe.style.fontFamily="monospace";
_1fe.setAttribute("wrap","off");
_1fe.wrap="off";
_1fe.style.overflow="auto";
_1fe.style.width="700px";
_1fe.style.height="350px";
_1fe.style.margin="5px";
_1ff.appendChild(_1fe);
}
_1fe.value+=_1fd+"\n";
_1fe.scrollTop=_1fe.scrollHeight-_1fe.clientHeight;
}
catch(ex){
alert("Exception: "+ex.name+" Message: "+ex.message);
}
};
if(typeof deconcept=="undefined"){
var deconcept=new Object();
}
if(typeof deconcept.util=="undefined"){
deconcept.util=new Object();
}
if(typeof deconcept.SWFObjectUtil=="undefined"){
deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject=function(swf,id,w,h,ver,c,_206,_207,_208,_209){
if(!document.getElementById){
return;
}
this.DETECT_KEY=_209?_209:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(swf){
this.setAttribute("swf",swf);
}
if(id){
this.setAttribute("id",id);
}
if(w){
this.setAttribute("width",w);
}
if(h){
this.setAttribute("height",h);
}
if(ver){
this.setAttribute("version",new deconcept.PlayerVersion(ver.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
deconcept.SWFObject.doPrepUnload=true;
}
if(c){
this.addParam("bgcolor",c);
}
var q=_206?_206:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var xir=(_207)?_207:window.location;
this.setAttribute("xiRedirectUrl",xir);
this.setAttribute("redirectUrl","");
if(_208){
this.setAttribute("redirectUrl",_208);
}
};
deconcept.SWFObject.prototype={useExpressInstall:function(path){
this.xiSWFPath=!path?"expressinstall.swf":path;
this.setAttribute("useExpressInstall",true);
},setAttribute:function(name,_20e){
this.attributes[name]=_20e;
},getAttribute:function(name){
return this.attributes[name];
},addParam:function(name,_211){
this.params[name]=_211;
},getParams:function(){
return this.params;
},addVariable:function(name,_213){
this.variables[name]=_213;
},getVariable:function(name){
return this.variables[name];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _215=new Array();
var key;
var _217=this.getVariables();
for(key in _217){
_215[_215.length]=key+"="+_217[key];
}
return _215;
},getSWFHTML:function(){
var _218="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);
}
_218="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";
_218+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _219=this.getParams();
for(var key in _219){
_218+=[key]+"=\""+_219[key]+"\" ";
}
var _21b=this.getVariablePairs().join("&");
if(_21b.length>0){
_218+="flashvars=\""+_21b+"\"";
}
_218+="/>";
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath);
}
_218="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";
_218+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _219=this.getParams();
for(var key in _219){
_218+="<param name=\""+key+"\" value=\""+_219[key]+"\" />";
}
var _21b=this.getVariablePairs().join("&");
if(_21b.length>0){
_218+="<param name=\"flashvars\" value=\""+_21b+"\" />";
}
_218+="</object>";
}
return _218;
},write:function(_21c){
if(this.getAttribute("useExpressInstall")){
var _21d=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21d)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _21c=="string")?document.getElementById(_21c):_21c;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){
document.location.href=(document.location.href+"").replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _21f=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_21f=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _222=3;
while(axo){
try{
_222++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_222);
_21f=new deconcept.PlayerVersion([_222,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_21f=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_21f.major==6){
return _21f;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_21f=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _21f;
};
deconcept.PlayerVersion=function(_223){
this.major=_223[0]!=null?parseInt(_223[0]):0;
this.minor=_223[1]!=null?parseInt(_223[1]):0;
this.rev=_223[2]!=null?parseInt(_223[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){
return false;
}
if(this.major>fv.major){
return true;
}
if(this.minor<fv.minor){
return false;
}
if(this.minor>fv.minor){
return true;
}
if(this.rev<fv.rev){
return false;
}
return true;
};
deconcept.util={getRequestParameter:function(_225){
try{
var q=document.location.search||document.location.hash;
if(_225==null){
return q;
}
}
catch(e){
return "";
}
if(q){
var _227=q.substring(1).split("&");
for(var i=0;i<_227.length;i++){
if(_227[i].substring(0,_227[i].indexOf("="))==_225){
return _227[i].substring((_227[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _229=document.getElementsByTagName("OBJECT");
for(var i=_229.length-1;i>=0;i--){
_229[i].style.display="none";
for(var x in _229[i]){
if(typeof _229[i][x]=="function"){
_229[i][x]=function(){
};
}
}
}
};
if(deconcept.SWFObject.doPrepUnload){
if(!deconcept.unloadSet){
deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
var swfobject=function(){
var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){
var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
if(typeof t.plugins!=D&&typeof t.plugins[S]==r){
ab=t.plugins[S].description;
if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){
T=true;
X=false;
ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);
ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;
}
}else{
if(typeof O.ActiveXObject!=D){
try{
var ad=new ActiveXObject(W);
if(ad){
ab=ad.GetVariable("$version");
if(ab){
X=true;
ab=ab.split(" ")[1].split(",");
ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];
}
}
}
catch(Z){
}
}
}
return {w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};
}(),k=function(){
if(!M.w3){
return;
}
if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){
f();
}
if(!J){
if(typeof j.addEventListener!=D){
j.addEventListener("DOMContentLoaded",f,false);
}
if(M.ie&&M.win){
j.attachEvent(x,function(){
if(j.readyState=="complete"){
j.detachEvent(x,arguments.callee);
f();
}
});
if(O==top){
(function(){
if(J){
return;
}
try{
j.documentElement.doScroll("left");
}
catch(X){
setTimeout(arguments.callee,0);
return;
}
f();
})();
}
}
if(M.wk){
(function(){
if(J){
return;
}
if(!/loaded|complete/.test(j.readyState)){
setTimeout(arguments.callee,0);
return;
}
f();
})();
}
s(f);
}
}();
function f(){
if(J){
return;
}
try{
var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));
Z.parentNode.removeChild(Z);
}
catch(aa){
return;
}
J=true;
var X=U.length;
for(var Y=0;Y<X;Y++){
U[Y]();
}
}
function K(X){
if(J){
X();
}else{
U[U.length]=X;
}
}
function s(Y){
if(typeof O.addEventListener!=D){
O.addEventListener("load",Y,false);
}else{
if(typeof j.addEventListener!=D){
j.addEventListener("load",Y,false);
}else{
if(typeof O.attachEvent!=D){
i(O,"onload",Y);
}else{
if(typeof O.onload=="function"){
var X=O.onload;
O.onload=function(){
X();
Y();
};
}else{
O.onload=Y;
}
}
}
}
}
function h(){
if(T){
V();
}else{
H();
}
}
function V(){
var X=j.getElementsByTagName("body")[0];
var aa=C(r);
aa.setAttribute("type",q);
var Z=X.appendChild(aa);
if(Z){
var Y=0;
(function(){
if(typeof Z.GetVariable!=D){
var ab=Z.GetVariable("$version");
if(ab){
ab=ab.split(" ")[1].split(",");
M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];
}
}else{
if(Y<10){
Y++;
setTimeout(arguments.callee,10);
return;
}
}
X.removeChild(aa);
Z=null;
H();
})();
}else{
H();
}
}
function H(){
var ag=o.length;
if(ag>0){
for(var af=0;af<ag;af++){
var Y=o[af].id;
var ab=o[af].callbackFn;
var aa={success:false,id:Y};
if(M.pv[0]>0){
var ae=c(Y);
if(ae){
if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){
w(Y,true);
if(ab){
aa.success=true;
aa.ref=z(Y);
ab(aa);
}
}else{
if(o[af].expressInstall&&A()){
var ai={};
ai.data=o[af].expressInstall;
ai.width=ae.getAttribute("width")||"0";
ai.height=ae.getAttribute("height")||"0";
if(ae.getAttribute("class")){
ai.styleclass=ae.getAttribute("class");
}
if(ae.getAttribute("align")){
ai.align=ae.getAttribute("align");
}
var ah={};
var X=ae.getElementsByTagName("param");
var ac=X.length;
for(var ad=0;ad<ac;ad++){
if(X[ad].getAttribute("name").toLowerCase()!="movie"){
ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value");
}
}
P(ai,ah,Y,ab);
}else{
p(ae);
if(ab){
ab(aa);
}
}
}
}
}else{
w(Y,true);
if(ab){
var Z=z(Y);
if(Z&&typeof Z.SetVariable!=D){
aa.success=true;
aa.ref=Z;
}
ab(aa);
}
}
}
}
}
function z(aa){
var X=null;
var Y=c(aa);
if(Y&&Y.nodeName=="OBJECT"){
if(typeof Y.SetVariable!=D){
X=Y;
}else{
var Z=Y.getElementsByTagName(r)[0];
if(Z){
X=Z;
}
}
}
return X;
}
function A(){
return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312);
}
function P(aa,ab,X,Z){
a=true;
E=Z||null;
B={success:false,id:X};
var ae=c(X);
if(ae){
if(ae.nodeName=="OBJECT"){
l=g(ae);
Q=null;
}else{
l=ae;
Q=X;
}
aa.id=R;
if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){
aa.width="310";
}
if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){
aa.height="137";
}
j.title=j.title.slice(0,47)+" - Flash Player Installation";
var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;
if(typeof ab.flashvars!=D){
ab.flashvars+="&"+ac;
}else{
ab.flashvars=ac;
}
if(M.ie&&M.win&&ae.readyState!=4){
var Y=C("div");
X+="SWFObjectNew";
Y.setAttribute("id",X);
ae.parentNode.insertBefore(Y,ae);
ae.style.display="none";
(function(){
if(ae.readyState==4){
ae.parentNode.removeChild(ae);
}else{
setTimeout(arguments.callee,10);
}
})();
}
u(aa,ab,X);
}
}
function p(Y){
if(M.ie&&M.win&&Y.readyState!=4){
var X=C("div");
Y.parentNode.insertBefore(X,Y);
X.parentNode.replaceChild(g(Y),X);
Y.style.display="none";
(function(){
if(Y.readyState==4){
Y.parentNode.removeChild(Y);
}else{
setTimeout(arguments.callee,10);
}
})();
}else{
Y.parentNode.replaceChild(g(Y),Y);
}
}
function g(ab){
var aa=C("div");
if(M.win&&M.ie){
aa.innerHTML=ab.innerHTML;
}else{
var Y=ab.getElementsByTagName(r)[0];
if(Y){
var ad=Y.childNodes;
if(ad){
var X=ad.length;
for(var Z=0;Z<X;Z++){
if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){
aa.appendChild(ad[Z].cloneNode(true));
}
}
}
}
}
return aa;
}
function u(ai,ag,Y){
var X,aa=c(Y);
if(M.wk&&M.wk<312){
return X;
}
if(aa){
if(typeof ai.id==D){
ai.id=Y;
}
if(M.ie&&M.win){
var ah="";
for(var ae in ai){
if(ai[ae]!=Object.prototype[ae]){
if(ae.toLowerCase()=="data"){
ag.movie=ai[ae];
}else{
if(ae.toLowerCase()=="styleclass"){
ah+=" class=\""+ai[ae]+"\"";
}else{
if(ae.toLowerCase()!="classid"){
ah+=" "+ae+"=\""+ai[ae]+"\"";
}
}
}
}
}
var af="";
for(var ad in ag){
if(ag[ad]!=Object.prototype[ad]){
af+="<param name=\""+ad+"\" value=\""+ag[ad]+"\" />";
}
}
aa.outerHTML="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\""+ah+">"+af+"</object>";
N[N.length]=ai.id;
X=c(ai.id);
}else{
var Z=C(r);
Z.setAttribute("type",q);
for(var ac in ai){
if(ai[ac]!=Object.prototype[ac]){
if(ac.toLowerCase()=="styleclass"){
Z.setAttribute("class",ai[ac]);
}else{
if(ac.toLowerCase()!="classid"){
Z.setAttribute(ac,ai[ac]);
}
}
}
}
for(var ab in ag){
if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){
e(Z,ab,ag[ab]);
}
}
aa.parentNode.replaceChild(Z,aa);
X=Z;
}
}
return X;
}
function e(Z,X,Y){
var aa=C("param");
aa.setAttribute("name",X);
aa.setAttribute("value",Y);
Z.appendChild(aa);
}
function y(Y){
var X=c(Y);
if(X&&X.nodeName=="OBJECT"){
if(M.ie&&M.win){
X.style.display="none";
(function(){
if(X.readyState==4){
b(Y);
}else{
setTimeout(arguments.callee,10);
}
})();
}else{
X.parentNode.removeChild(X);
}
}
}
function b(Z){
var Y=c(Z);
if(Y){
for(var X in Y){
if(typeof Y[X]=="function"){
Y[X]=null;
}
}
Y.parentNode.removeChild(Y);
}
}
function c(Z){
var X=null;
try{
X=j.getElementById(Z);
}
catch(Y){
}
return X;
}
function C(X){
return j.createElement(X);
}
function i(Z,X,Y){
Z.attachEvent(X,Y);
I[I.length]=[Z,X,Y];
}
function F(Z){
var Y=M.pv,X=Z.split(".");
X[0]=parseInt(X[0],10);
X[1]=parseInt(X[1],10)||0;
X[2]=parseInt(X[2],10)||0;
return (Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false;
}
function v(ac,Y,ad,ab){
if(M.ie&&M.mac){
return;
}
var aa=j.getElementsByTagName("head")[0];
if(!aa){
return;
}
var X=(ad&&typeof ad=="string")?ad:"screen";
if(ab){
n=null;
G=null;
}
if(!n||G!=X){
var Z=C("style");
Z.setAttribute("type","text/css");
Z.setAttribute("media",X);
n=aa.appendChild(Z);
if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){
n=j.styleSheets[j.styleSheets.length-1];
}
G=X;
}
if(M.ie&&M.win){
if(n&&typeof n.addRule==r){
n.addRule(ac,Y);
}
}else{
if(n&&typeof j.createTextNode!=D){
n.appendChild(j.createTextNode(ac+" {"+Y+"}"));
}
}
}
function w(Z,X){
if(!m){
return;
}
var Y=X?"visible":"hidden";
if(J&&c(Z)){
c(Z).style.visibility=Y;
}else{
v("#"+Z,"visibility:"+Y);
}
}
function L(Y){
var Z=/[\\\"<>\.;]/;
var X=Z.exec(Y)!=null;
return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y;
}
var d=function(){
if(M.ie&&M.win){
window.attachEvent("onunload",function(){
var ac=I.length;
for(var ab=0;ab<ac;ab++){
I[ab][0].detachEvent(I[ab][1],I[ab][2]);
}
var Z=N.length;
for(var aa=0;aa<Z;aa++){
y(N[aa]);
}
for(var Y in M){
M[Y]=null;
}
M=null;
for(var X in swfobject){
swfobject[X]=null;
}
swfobject=null;
});
}
}();
return {registerObject:function(ab,X,aa,Z){
if(M.w3&&ab&&X){
var Y={};
Y.id=ab;
Y.swfVersion=X;
Y.expressInstall=aa;
Y.callbackFn=Z;
o[o.length]=Y;
w(ab,false);
}else{
if(Z){
Z({success:false,id:ab});
}
}
},getObjectById:function(X){
if(M.w3){
return z(X);
}
},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){
var X={success:false,id:ah};
if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){
w(ah,false);
K(function(){
ae+="";
ag+="";
var aj={};
if(af&&typeof af===r){
for(var al in af){
aj[al]=af[al];
}
}
aj.data=ab;
aj.width=ae;
aj.height=ag;
var am={};
if(ad&&typeof ad===r){
for(var ak in ad){
am[ak]=ad[ak];
}
}
if(Z&&typeof Z===r){
for(var ai in Z){
if(typeof am.flashvars!=D){
am.flashvars+="&"+ai+"="+Z[ai];
}else{
am.flashvars=ai+"="+Z[ai];
}
}
}
if(F(Y)){
var an=u(aj,am,ah);
if(aj.id==ah){
w(ah,true);
}
X.success=true;
X.ref=an;
}else{
if(aa&&A()){
aj.data=aa;
P(aj,am,ah,ac);
return;
}else{
w(ah,true);
}
}
if(ac){
ac(X);
}
});
}else{
if(ac){
ac(X);
}
}
},switchOffAutoHideShow:function(){
m=false;
},ua:M,getFlashPlayerVersion:function(){
return {major:M.pv[0],minor:M.pv[1],release:M.pv[2]};
},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){
if(M.w3){
return u(Z,Y,X);
}else{
return undefined;
}
},showExpressInstall:function(Z,aa,X,Y){
if(M.w3&&A()){
P(Z,aa,X,Y);
}
},removeSWF:function(X){
if(M.w3){
y(X);
}
},createCSS:function(aa,Z,Y,X){
if(M.w3){
v(aa,Z,Y,X);
}
},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){
var Z=j.location.search||j.location.hash;
if(Z){
if(/\?/.test(Z)){
Z=Z.split("?")[1];
}
if(aa==null){
return L(Z);
}
var Y=Z.split("&");
for(var X=0;X<Y.length;X++){
if(Y[X].substring(0,Y[X].indexOf("="))==aa){
return L(Y[X].substring((Y[X].indexOf("=")+1)));
}
}
}
return "";
},expressInstallCallback:function(){
if(a){
var X=c(R);
if(X&&l){
X.parentNode.replaceChild(l,X);
if(Q){
w(Q,true);
if(M.ie&&M.win){
l.style.display="block";
}
}
if(E){
E(B);
}
}
a=false;
}
}};
}();
var MIN_YEAR=1891,MAX_YEAR=2100;
var lunarInfo=[[0,2,9,21936],[6,1,30,9656],[0,2,17,9584],[0,2,6,21168],[5,1,26,43344],[0,2,13,59728],[0,2,2,27296],[3,1,22,44368],[0,2,10,43856],[8,1,30,19304],[0,2,19,19168],[0,2,8,42352],[5,1,29,21096],[0,2,16,53856],[0,2,4,55632],[4,1,25,27304],[0,2,13,22176],[0,2,2,39632],[2,1,22,19176],[0,2,10,19168],[6,1,30,42200],[0,2,18,42192],[0,2,6,53840],[5,1,26,54568],[0,2,14,46400],[0,2,3,54944],[2,1,23,38608],[0,2,11,38320],[7,2,1,18872],[0,2,20,18800],[0,2,8,42160],[5,1,28,45656],[0,2,16,27216],[0,2,5,27968],[4,1,24,44456],[0,2,13,11104],[0,2,2,38256],[2,1,23,18808],[0,2,10,18800],[6,1,30,25776],[0,2,17,54432],[0,2,6,59984],[5,1,26,27976],[0,2,14,23248],[0,2,4,11104],[3,1,24,37744],[0,2,11,37600],[7,1,31,51560],[0,2,19,51536],[0,2,8,54432],[6,1,27,55888],[0,2,15,46416],[0,2,5,22176],[4,1,25,43736],[0,2,13,9680],[0,2,2,37584],[2,1,22,51544],[0,2,10,43344],[7,1,29,46248],[0,2,17,27808],[0,2,6,46416],[5,1,27,21928],[0,2,14,19872],[0,2,3,42416],[3,1,24,21176],[0,2,12,21168],[8,1,31,43344],[0,2,18,59728],[0,2,8,27296],[6,1,28,44368],[0,2,15,43856],[0,2,5,19296],[4,1,25,42352],[0,2,13,42352],[0,2,2,21088],[3,1,21,59696],[0,2,9,55632],[7,1,30,23208],[0,2,17,22176],[0,2,6,38608],[5,1,27,19176],[0,2,15,19152],[0,2,3,42192],[4,1,23,53864],[0,2,11,53840],[8,1,31,54568],[0,2,18,46400],[0,2,7,46752],[6,1,28,38608],[0,2,16,38320],[0,2,5,18864],[4,1,25,42168],[0,2,13,42160],[10,2,2,45656],[0,2,20,27216],[0,2,9,27968],[6,1,29,44448],[0,2,17,43872],[0,2,6,38256],[5,1,27,18808],[0,2,15,18800],[0,2,4,25776],[3,1,23,27216],[0,2,10,59984],[8,1,31,27432],[0,2,19,23232],[0,2,7,43872],[5,1,28,37736],[0,2,16,37600],[0,2,5,51552],[4,1,24,54440],[0,2,12,54432],[0,2,1,55888],[2,1,22,23208],[0,2,9,22176],[7,1,29,43736],[0,2,18,9680],[0,2,7,37584],[5,1,26,51544],[0,2,14,43344],[0,2,3,46240],[4,1,23,46416],[0,2,10,44368],[9,1,31,21928],[0,2,19,19360],[0,2,8,42416],[6,1,28,21176],[0,2,16,21168],[0,2,5,43312],[4,1,25,29864],[0,2,12,27296],[0,2,1,44368],[2,1,22,19880],[0,2,10,19296],[6,1,29,42352],[0,2,17,42208],[0,2,6,53856],[5,1,26,59696],[0,2,13,54576],[0,2,3,23200],[3,1,23,27472],[0,2,11,38608],[11,1,31,19176],[0,2,19,19152],[0,2,8,42192],[6,1,28,53848],[0,2,15,53840],[0,2,4,54560],[5,1,24,55968],[0,2,12,46496],[0,2,1,22224],[2,1,22,19160],[0,2,10,18864],[7,1,30,42168],[0,2,17,42160],[0,2,6,43600],[5,1,26,46376],[0,2,14,27936],[0,2,2,44448],[3,1,23,21936],[0,2,11,37744],[8,2,1,18808],[0,2,19,18800],[0,2,8,25776],[6,1,28,27216],[0,2,15,59984],[0,2,4,27424],[4,1,24,43872],[0,2,12,43744],[0,2,2,37600],[3,1,21,51568],[0,2,9,51552],[7,1,29,54440],[0,2,17,54432],[0,2,5,55888],[5,1,26,23208],[0,2,14,22176],[0,2,3,42704],[4,1,23,21224],[0,2,11,21200],[8,1,31,43352],[0,2,19,43344],[0,2,7,46240],[6,1,27,46416],[0,2,15,44368],[0,2,5,21920],[4,1,24,42448],[0,2,12,42416],[0,2,2,21168],[3,1,22,43320],[0,2,9,26928],[7,1,29,29336],[0,2,17,27296],[0,2,6,44368],[5,1,26,19880],[0,2,14,19296],[0,2,3,42352],[4,1,24,21104],[0,2,10,53856],[8,1,30,59696],[0,2,18,54560],[0,2,7,55968],[6,1,27,27472],[0,2,15,22224],[0,2,5,19168],[4,1,25,42216],[0,2,12,42192],[0,2,1,53584],[2,1,21,55592],[0,2,9,54560]];
function convertSolarToLunar(year,_2d7,date){
if(_2d7==""||date==""){
return [year,(_2d7==""?"":getCapitalNum(_2d7,true)),(date==""?"":getCapitalNum(date)),getLunarYearName(year),0,0,getYearZodiac(year)];
}
var _2d9=lunarInfo[year-MIN_YEAR];
if(year==MIN_YEAR&&_2d7<=2&&date<=9){
return [1891,"\u6b63\u6708","\u521d\u4e00","\u8f9b\u536f",1,1,"\u5154"];
}
return getLunarByBetween(year,getDaysBetweenSolar(year,_2d7,date,_2d9[1],_2d9[2]));
}
function convertLunarToSolar(year,_2db,date){
if(_2db==""||date==""){
return [year,_2db,date];
}
var _2dd=lunarInfo[year-MIN_YEAR],res=new Date(year,_2dd[1]-1,_2dd[2]),_2df=getDaysBetweenLunar(year,_2db,date);
res.setDate(res.getDate()+_2df);
return [res.getFullYear(),res.getMonth()+1,res.getDate()];
}
function isLeapYear(year){
return ((year%4==0&&year%100!=0)||(year%400==0));
}
function getLunarYearName(year){
var sky=["\u5e9a","\u8f9b","\u58ec","\u7678","\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1"],_2e3=["\u7533","\u9149","\u620c","\u4ea5","\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a"];
return sky[(year+"").charAt(3)]+_2e3[year%12];
}
function getYearZodiac(year){
var _2e5=["\u7334","\u9e21","\u72d7","\u732a","\u9f20","\u725b","\u864e","\u5154","\u9f99","\u86c7","\u9a6c","\u7f8a"];
return _2e5[year%12];
}
function getSolarMonthDays(year,_2e7){
var _2e8={1:31,2:(isLeapYear(year)?29:28),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31};
return _2e8[_2e7];
}
function getLunarMonthDays(year,_2ea){
var _2eb=getLunarMonths(year);
return _2eb[_2ea-1];
}
function getLunarMonths(year){
var _2ed=lunarInfo[year-MIN_YEAR],_2ee=_2ed[0],_2ef=(_2ed[3]).toString(2).split("");
for(var k=0,klen=16-_2ef.length;k<klen;k++){
_2ef.unshift("0");
}
_2ef=_2ef.slice(0,(_2ee==0?12:13));
for(var i=0,len=_2ef.length;i<len;i++){
_2ef[i]=parseInt(_2ef[i])+29;
}
return _2ef;
}
function getLunarMonthsLength(year){
return getLunarMonths(year).length;
}
function getLunarMonthNames(year){
var _2f6=getLeapMonth(year),_2f7=[],_2f8=(_2f6==0?12:13),_2f9=["\u6b63\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u51ac\u6708","\u814a\u6708"];
if(_2f6){
_2f9.splice(_2f6,0,"\u95f0"+_2f9[_2f6-1]);
}
for(var i=0;i<_2f8;i++){
_2f7.push(_2f9[i]);
}
return _2f7;
}
function getLunarDates(year,_2fc){
var _2fd=[];
var days=getLunarMonthDays(year,_2fc);
for(var i=1;i<=days;i++){
_2fd.push(getCapitalNum(i,false));
}
return _2fd;
}
function getMaxLunarDates(){
var _300=[];
for(var i=1;i<=30;i++){
_300.push(getCapitalNum(i,false));
}
return _300;
}
function getLunarYearDays(year){
var _303=lunarInfo[year-MIN_YEAR],_304=getLunarYearMonths(year),len=_304.length;
return (_304[len-1]==0?_304[len-2]:_304[len-1]);
}
function getLunarYearMonths(year){
var _307=getLunarMonths(year),res=[],temp=0,_30a=lunarInfo[year-MIN_YEAR],len=(_30a[0]==0?12:13);
for(var i=0;i<len;i++){
temp=0;
for(var j=0;j<=i;j++){
temp+=_307[j];
}
res.push(temp);
}
return res;
}
function getLeapMonth(year){
if(year<MIN_YEAR){
return 0;
}
var _30f=lunarInfo[year-MIN_YEAR];
return _30f[0];
}
function getDaysBetweenLunar(year,_311,date){
var _313=getLunarMonths(year),res=0;
for(var i=1;i<_311;i++){
res+=_313[i-1];
}
res+=date-1;
return res;
}
function getDaysBetweenSolar(year,_317,_318,_319,_31a){
var a=new Date(year,_317-1,_318),b=new Date(year,_319-1,_31a);
return Math.ceil((a-b)/24/3600/1000);
}
function getLunarByBetween(year,_31e){
var _31f=[],_320=[],t=0,e=0,_323=0,m="";
if(_31e==0){
_31f.push(year,"\u6b63\u6708","\u521d\u4e00");
}else{
year=_31e>0?year:(year-1);
_320=getLunarYearMonths(year);
_323=getLeapMonth(year);
_31e=_31e>0?_31e:(getLunarYearDays(year)+_31e);
for(var i=0;i<13;i++){
if(_31e==_320[i]){
t=i+2;
e=1;
break;
}else{
if(_31e<_320[i]){
t=i+1;
e=_31e-(_320[i-1]==undefined?0:_320[i-1])+1;
break;
}
}
}
m=(_323!=0&&t==_323+1)?("\u95f0"+getCapitalNum(t-1,true)):getCapitalNum((_323!=0&&_323+1<t?(t-1):t),true);
_31f.push(year,m,getCapitalNum(e,false));
}
_31f.push(getLunarYearName(year));
_31f.push(t,e);
_31f.push(getYearZodiac(year));
return _31f;
}
function getCapitalNum(num,_327){
_327=_327||false;
var _328={1:"\u4e00",2:"\u4e8c",3:"\u4e09",4:"\u56db",5:"\u4e94",6:"\u516d",7:"\u4e03",8:"\u516b",9:"\u4e5d",10:"\u5341"},_329={1:"\u6b63\u6708",2:"\u4e8c\u6708",3:"\u4e09\u6708",4:"\u56db\u6708",5:"\u4e94\u6708",6:"\u516d\u6708",7:"\u4e03\u6708",8:"\u516b\u6708",9:"\u4e5d\u6708",10:"\u5341\u6708",11:"\u51ac\u6708",12:"\u814a\u6708"},res="";
if(_327){
res=_329[num];
}else{
if(num<=10){
res="\u521d"+_328[num];
}else{
if(num>10&&num<20){
res="\u5341"+_328[num-10];
}else{
if(num==20){
res="\u4e8c\u5341";
}else{
if(num>20&&num<30){
res="\u5eff"+_328[num-20];
}else{
if(num==30){
res="\u4e09\u5341";
}
}
}
}
}
}
return res;
}
XN.namespace("config.status");
XN.config.status.enableMedia=false;
XN.config.status.enableReplyAll=false;
XN.config.status.params="";
function getWWWRoot(_32b){
if(XN.page&&XN.page.data&&XN.page.data.type==5){
return "lover.renren.com";
}else{
return _32b?"org.renren.com":"page.renren.com";
}
}
XN.namespace("app.status");
XN.event.enableCustomEvent(XN.app.status);
XN.app.status.crossDomain=1;
setCursor2Start=function(_32c){
if(_32c.setSelectionRange){
_32c.setSelectionRange(0,0);
}else{
if(_32c.createTextRange){
var _32d=_32c.createTextRange();
_32d.collapse(true);
_32d.moveEnd("character",0);
_32d.moveStart("character",0);
_32d.select();
}
}
try{
_32c.focus();
}
catch(e){
}
};
XN.APP.status.getVideoScale=function(url){
if(/tudou/i.test(url)){
return [400,300];
}else{
if(/youtube/i.test(url)){
return [425,355];
}else{
if(/youku/i.test(url)){
return [480,400];
}else{
if(/sina/i.test(url)){
return [480,370];
}else{
if(/qq/i.test(url)){
return [456,362];
}else{
if(/mofile/i.test(url)){
return [480,395];
}else{
if(/ku6/i.test(url)){
return [460,390];
}else{
if(/openv/i.test(url)){
return [500,460];
}
}
}
}
}
}
}
}
};
function playStatusVideo(sid,url,el){
url=decodeURIComponent(url);
var _332=XN.APP.status.getVideoScale(url);
var html=XN.Template.flash({width:_332[0],height:_332[1],filename:url});
var p=el.parentNode;
if(!$("media"+sid)||(p.id&&p.id=="currentStatus")||(p&&/currentStatus/.test(p.className))){
XN.DO.alert({title:"\u72b6\u6001",message:"<center style=\"padding:10px\">"+html+"</center>",width:_332[0]+80,button:"\u5173\u95ed",callBack:function(){
this.body.setContent("");
},noHeader:true});
}else{
if(/^\S*$/.test($("media"+sid).innerHTML)){
$("media"+sid).innerHTML="<div class=\"feedmediabox\">"+html+"</div>";
if(el){
$(el).addClass("expand");
}
}else{
$("media"+sid).innerHTML="";
if(el){
el.delClass("expand");
}
}
}
}
function playStatusAudio(sid,url,el){
var html;
if(/mp3$/i.test(url)){
html=XN.Template.flashPlayer({filename:url});
}else{
html=XN.Template.mediaPlayer({filename:url});
}
var p=el.parentNode;
if(!$("media"+sid)||(p.id&&p.id=="currentStatus")||(p&&/currentStatus/.test(p.className))){
XN.DO.alert({title:"\u72b6\u6001",message:"<center style=\"padding:10px\">"+html+"</center>",width:500,button:"\u5173\u95ed",callBack:function(){
this.body.setContent("");
},noHeader:true});
}else{
if(/^\S*$/.test($("media"+sid).innerHTML)){
$("media"+sid).innerHTML="<div class=\"feedmediabox\">"+html+"</div>";
if(el){
$(el).addClass("expand");
}
}else{
$("media"+sid).innerHTML="";
if(el){
el.delClass("expand");
}
}
}
}
function $CursorPosition(_33a){
var _33b=0,end=0;
if(typeof (_33a.selectionStart)=="number"){
_33b=_33a.selectionStart;
end=_33a.selectionEnd;
}else{
if(document.selection){
var _33d=document.selection.createRange();
if(_33d.parentElement()==_33a){
var _33e=document.body.createTextRange();
_33e.moveToElementText(_33a);
for(_33b=0;_33e.compareEndPoints("StartToStart",_33d)<0;_33b++){
_33e.moveStart("character",1);
}
for(var i=0;i<=_33b;i++){
if(_33a.value.charAt(i)=="\n"){
_33b++;
}
}
var _33e=document.body.createTextRange();
_33e.moveToElementText(_33a);
for(end=0;_33e.compareEndPoints("StartToEnd",_33d)<0;end++){
_33e.moveStart("character",1);
}
for(var i=0;i<=end;i++){
if(_33a.value.charAt(i)=="\n"){
end++;
}
}
}
}
}
return {"start":_33b,"end":end,"item":[_33b,end]};
}
function renderStatusFeed(id,href){
return;
}
(function(ns){
var _343=XN.ENV.staticRoot;
ns._errors={1:"\u8bf7\u4e0d\u8981\u4ece\u7ad9\u5916\u63d0\u4ea4",2:"\u8be5\u72b6\u6001\u4e0d\u5b58\u5728",6:"\u5bf9\u4e0d\u8d77\uff0c\u8bf7\u91cd\u8bd5\u3002",3:"\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001",4:"\u62b1\u6b49\uff0c\u67d0\u4e9b\u4fe1\u606f\u662f\u4e0d\u80fd\u53d1\u5e03\u7684\u54e6\uff1a\uff09\u8c22\u8c22\u60a8\u7684\u8c05\u89e3\u3002",5:"\u4f60\u77ed\u65f6\u95f4\u5185\u53d1\u8868\u4e86\u592a\u591a\u76f8\u540c\u7684\u5185\u5bb9",9:"\u4f60\u8fd8\u4e0d\u662fTA\u7684\u597d\u53cb\uff0c\u4e0d\u80fd\u4f7f\u7528\u201c\u56de\u590d\u6240\u6709\u4eba\u201d",10:"\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u5220\u9664",11:"\u8be5\u7528\u6237\u4e0d\u662f\u60a8\u7684\u597d\u53cb, \u4e0d\u80fd\u8f6c\u53d1\u5176\u72b6\u6001",12:"\u53c2\u6570\u4e0d\u5b8c\u6574, \u63d0\u4ea4\u5931\u8d25, \u8bf7\u8054\u7cfb\u5ba2\u670d",15:"\u8bf7\u6fc0\u6d3b\u8d26\u53f7",16:"\u62b1\u6b49\uff0c\u7531\u4e8e\u5bf9\u65b9\u7684\u9690\u79c1\u8bbe\u7f6e\uff0c\u4f60\u65e0\u6cd5\u8fdb\u884c\u8be5\u64cd\u4f5c",100:"\u672c\u516c\u5171\u4e3b\u9875\u7ba1\u7406\u5458\u5173\u95ed\u4e86\u8be5\u516c\u5171\u4e3b\u9875\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",101:"\u4f60\u73b0\u5728\u4e0d\u662f\u8be5\u516c\u5171\u4e3b\u9875\u7684\u7c89\u4e1d\uff0c\u6210\u4e3a\u7c89\u4e1d\u540e\u624d\u53ef\u56de\u590d",102:"\u6b64\u516c\u5171\u4e3b\u9875\u7684\u4e3b\u4eba\u5173\u95ed\u4e86\u56de\u590d\u529f\u80fd\uff0c\u76ee\u524d\u4e0d\u80fd\u56de\u590d",103:"\u68c0\u6d4b\u5230\u5f02\u5e38\u65e0\u6cd5\u53d1\u5e03\uff0c\u8bf7\u5c1d\u8bd5\u5237\u65b0\u9875\u9762\u6216\u91cd\u65b0\u767b\u5f55",105:"\u4f60\u73b0\u5728\u4e0d\u662f\u8be5\u60c5\u4fa3\u7a7a\u95f4\u7684\u5173\u6ce8\u8005\uff0c\u52a0\u5165\u540e\u624d\u53ef\u56de\u590d",106:"\u8be5\u62a5\u5230\u4e0d\u5b58\u5728",107:"\u56de\u590d\u5931\u8d25"};
ns.getError=function(code){
return this._errors[code]||false;
};
ns.getProfileRef=function(){
if(arguments.callee.ref){
return arguments.callee.ref;
}
var url=window.location.href+"";
var ref="";
if(url.indexOf("Home.do")!==-1){
ref="newsfeed";
}else{
ref="minifeed";
}
arguments.callee.ref=ref;
return ref;
};
})(XN.APP.status);
(function(ns){
var _348=XN.STRING;
var _349=false;
function log(str){
if(_349){
XN.log(str);
}
}
ns.updateAction=function(_34b){
$extend(this,_34b);
};
var _34c="";
ns.fwdRef="";
ns.setForwardTrue=function(_34d,_34e,type,_350,_351){
this.fwdid=_34d||null;
this.fwdOwner=_34e||null;
this.fwdRef="fwdRef="+type;
_34c="&fwdId="+this.fwdid+"&fwdOwner="+this.fwdOwner+"&statID="+_350+"&level="+_351;
};
ns.getForwardParam=function(){
return _34c;
};
ns.setForwardNull=function(){
_34c="";
this.fwdRef="";
};
ns.updateAction.prototype={maxLength:240,requestURI:"http://status."+XN.env.domain+"/doing/update.do",parseMediaURI:"http://share."+XN.env.domain+"/share/GetUrlInfo.do",enableMedia:false,_tscCode:null,_postRequest:null,_getMediaRequest:null,addOnsParam:{},abort:function(){
try{
this._postRequest.abort();
}
catch(e){
}
try{
this._getMediaRequest.abort();
}
catch(e){
}
},update:function(sstr){
var This=this;
sstr=_348.trim(sstr);
if(sstr===""){
this.fireEvent("postError","\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001",sstr);
return;
}
if(sstr.length>this.maxLength){
this.fireEvent("postError","\u60a8\u6700\u591a\u80fd\u591f\u8f93\u5165"+this.maxLength+"\u4e2a\u5b57\u7b26",sstr);
return;
}
var regx=/@\S+\(\d+\)$/;
if(regx.test(sstr)){
sstr+=" ";
}
this.fireEvent("beforePost");
if(this.enableMedia&&XN.config.status.enableMedia){
this._parseMedia(sstr);
}else{
this._updateStatus(sstr);
}
},_parseMedia:function(sstr){
var This=this;
var _357=/http:\/\/[A-Za-z0-9\%\-\:\+\#\.\?=&_~\/]+[^\:\(\s\u0391-\uFFE5]/i.exec(sstr);
if(!_357){
this._updateStatus(sstr);
return;
}
var link=_357[0],_359;
var _35a;
if(/(mp3|wma)$/i.test(link)){
_359={type:2,link:link};
_35a=sstr.replace(link,"[audio]");
this._updateStatus(sstr,_35a,_359);
return;
}
new XN.NET.xmlhttp({url:This.parseMediaURI+"?link="+encodeURIComponent(link),method:"get",onSuccess:function(r){
try{
var m=XN.JSON.parse(r.responseText);
}
catch(e){
This._updateStatus(sstr);
return;
}
switch(m.type){
case 10:
_359={type:3,link:m.url};
_35a=sstr.replace(link,"[video]");
break;
case 6:
_359={type:1,link:link};
_35a=sstr.replace(link,"[link]");
break;
}
This._updateStatus(sstr,_35a,_359);
},onError:function(){
This._updateStatus(sstr);
}});
},_updateStatus:function(sstr,_35e,_35f){
var This=this;
var data={};
data["c"]=_35e||sstr;
if(_35f){
data["media"]=XN.json.build(_35f);
}
data["raw"]=sstr;
var _362=XN.array.toQueryString(data);
_362+="&"+XN.config.status.params;
_362+=_34c;
for(var i in this.addOnsParam){
_362+="&"+i+"="+this.addOnsParam[i];
}
var _364=$("publisher_form_ticket");
if(_364){
_362+="&"+_364.id+"="+_364.value;
}
var url=this.requestURI+"?"+XN.app.status.fwdRef;
this._postRequest=new XN.NET.xmlhttp({url:url,data:_362,onComplete:function(){
This.fireEvent("postComplete");
},onSuccess:function(r){
try{
r=XN.JSON.parse(r.responseText);
if(r.code==0){
if(XN.STRING.isBlank(r.msg)){
r.msg="\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...";
}
This.fireEvent("postSuccess",r.msg,sstr,r);
XN.app.status.fireEvent("postSuccess",r.msg,sstr,r);
XN.app.status.setForwardNull();
}else{
This.fireEvent("postError",XN.APP.status.getError(r.code),r.msg,r.code);
XN.app.status.fireEvent("postError",XN.APP.status.getError(r.code),r.msg,r.code);
}
}
catch(e){
This.fireEvent("postError");
}
},onError:function(){
This.fireEvent("postError");
}});
}};
XN.EVENT.enableCustomEvent(ns.updateAction.prototype);
})(XN.APP.status);
(function(ns){
ns.Publicer=function(_368){
$extend(this,_368);
this.init();
};
ns.Publicer.prototype={IDinput:"publicer_input",IDsubmit:"publicer_submit",TIPinputDefault:"\u4f60\u6b63\u5728\u5e72\u561b",maxLength:140,checkers:{isOK:true,list:[],msg:{}},init:function(){
this.checkers.list.push(this.emptyCheck);
this.checkers.list.push(this.wordNumCheck);
this.checkers.list.push(this.defaultTextCheck);
this.action=this.postAction||new XN.APP.status.updateAction();
this.getUIRef();
this.UIInit();
this.bindEvent();
},getUIRef:function(){
this.input=$(this.IDinput);
this.submitBtn=$(this.IDsubmit);
},UIInit:function(){
this._inputHelper=new XN.FORM.inputHelper(this.input);
this._inputHelper.setDefaultValue(this.TIPinputDefault);
},bindEvent:function(){
var This=this;
this.submitBtn.addEvent("click",function(){
This.update(This.input.value);
});
this.action.addEvent("postError",function(msg){
This.fireEvent("publicer_update_error",msg);
});
this.action.addEvent("postSuccess",function(msg,send,r){
This.fireEvent("publicer_update_success",msg,send,r);
});
this.input.addEvent("keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
if(This.input.mention&&This.input.mention.selectorShow&&!This.input.mention.noMatch){
return;
}
This.update(This.input.value);
This.input.blur();
}
});
object.use("xn.mention",function(_36f,xn){
xn.mention.Mention.init([{obj:This.input,ugcId:"",ugcType:"status",ownerId:XN.user.id}]);
});
},check:function(str){
var _372={isOk:true,msg:"ok"};
var len=this.checkers.list.length;
for(var i=0;i<len;i++){
this.checkers.list[i].call(this,str,_372);
if(!_372.isOk){
return _372;
}
}
return _372;
},emptyCheck:function(str,_376){
if(!str){
_376.isOk=false;
_376.msg=ns._errors[3];
return;
}
},wordNumCheck:function(str,_378){
if(str&&(XN.string.trim(str).length>this.maxLength)){
_378.isOk=false;
_378.msg="\u62b1\u6b49,\u7559\u8a00\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc7140\u5b57";
}
},defaultTextCheck:function(str,_37a){
if(str==this.TIPinputDefault){
_37a.isOk=false;
_37a.msg=ns._errors[3];
}
},update:function(str){
var _37c=this.check(str);
if(_37c.isOk){
this.action.addOnsParam=this.addOnsParam;
this.fireEvent("publicer_before_post",str);
this.action.update(str);
this.fireEvent("publicer_after_post",str);
}else{
this.fireEvent("publicer_check_error",_37c.msg);
}
}};
XN.event.enableCustomEvent(ns.Publicer.prototype);
})(XN.APP.status);
(function(ns){
var _37e=XN.STRING;
var _37f=XN.EVENT.addEvent;
var _380;
var _381=true;
function log(s){
if(_381){
XN.log(s);
}
}
ns.editor=function(_383){
$extend(this,_383);
this.init();
};
ns.editor.prototype={IDsubmit:"publisher_statusSubmit",IDinput:"publisher_statusInput",IDcounter:"statusCount",IDinputContent:"statusContent",IDcurrentStatus:"currentStatus",IDoriginalStatus:"currentStatus_bak",IDupdateTime:"statusUpdateTime",IDemotion:"status_emotion",IDemoPan:"status_emotions",IDemoBtn:"status_emotion_legend",IDmentionBtn:"status_mention_button",IDspecial:"commendStatus",IDtools:"publisher_tools",IDerr:"publisher_err",IDmsg:"publisher_msg",TIPinputDefault:"\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u597d\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",TIPonPostError:"\u72b6\u6001\u66f4\u65b0\u5931\u8d25,\u8bf7\u5237\u65b0\u9875\u9762\u6216\u91cd\u65b0\u767b\u5f55",TIPupdateTime:"\u521a\u521a\u66f4\u65b0",TIPnewUser:"\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",CFGshowError:true,CFGmaxLength:240,CFGspCookieName:"sta1",CFGshowMax:true,action:null,_lastStatus:null,actionParam:null,_uiType:"home",getConfig:function(key){
return this["CFG"+key];
},getEl:function(id){
return $(this["ID"+id]);
},getTip:function(key){
return this["TIP"+key];
},init:function(){
var This=this,ac;
this._patchForNewUser();
this.action=ac=new XN.APP.status.updateAction($extend({maxLength:this.getConfig("maxLength"),enableMedia:true},this.actionParam));
ac.addEvent("beforePost",function(){
This._beforePost();
});
ac.addEvent("postSuccess",function(msg,send,_38b){
This._onPostSuccess(msg);
This.fireEvent("updateSuccess",msg,send,_38b);
});
ac.addEvent("postError",function(r,msg,code){
This._onPostError(r,msg,code);
This.fireEvent("updateError",r,msg,code);
});
this._disableSubmit();
var _38f=this.getEl("input");
_38f.addEvent("focus",function(e){
This._onInputFocus(e);
This.fireEvent("inputFocus",_38f.value);
},false);
_38f.addEvent("blur",function(e){
This._onBlur();
This.fireEvent("inputBlur",_38f.value);
});
this._inputHelper=new XN.FORM.inputHelper(this.getEl("input")).limit(this.getConfig("maxLength"),false).count(this.getEl("counter"),false).setDefaultValue(this.getTip("inputDefault"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
if(e.keyCode==13){
if(This.getEl("input").mention&&This.getEl("input").mention.selectorShow&&!This.getEl("input").mention.noMatch){
return;
}
This.fireEvent("beforeUpdate");
This.getEl("input").blur();
This.update(This.getEl("input").value);
}
});
object.use("xn.mention",function(_393,xn){
xn.mention.Mention.init([{obj:This.getEl("input"),ugcId:"",ugcType:"status",ownerId:XN.user.id,button:This.getEl("mentionBtn")}]);
});
this.getEl("emotion").addEvent("click",function(e){
This._parseEmotionEvent(e);
XN.EVENT.stop(e||window.event);
}).addEvent("mouseover",function(e){
This._overEmotion=true;
}).addEvent("mouseleave",function(){
This._overEmotion=false;
}).addEvent("mousedown",function(e){
This.getInputPos();
XN.event.stop(e||window.event);
});
if(this.getEl("special")){
this.getEl("special").addEvent("mousedown",function(){
This.getInputPos();
});
}
if(this.getEl("emoBtn")){
this._uiType="other";
this.showEmotion=function(){
var p=this.getEl("emoPan");
var btn=this.getEl("emoBtn");
if(p){
p.show();
}
if(btn){
btn.hide();
}
};
this.hideEmotion=function(){
var p=this.getEl("emoPan");
var btn=this.getEl("emoBtn");
if(p){
p.hide();
}
if(btn){
btn.show();
}
};
this.getEl("emoBtn").onclick=function(e){
var pos=This._inputHelper.cursorPosition();
This._inputHelper.focus(pos.start);
This.showEmotion();
XN.event.stop(e||window.event);
};
}else{
this.showEmotion=function(){
this.getEl("emotion").show();
};
this.hideEmotion=function(){
this.getEl("emotion").hide();
};
}
this._enableSubmit();
},showErr:function(msg){
if(this.IDerr){
var t=$(this.IDerr);
if(t){
t.innerHTML=msg;
t.show();
}
}
},hideErr:function(){
if(this.IDerr){
var t=$(this.IDerr);
if(t){
t.hide();
}
}
},showMsg:function(msg){
if(this.IDmsg){
var t=$(this.IDmsg);
if(t){
t.innerHTML=msg;
t.show();
}
}
},hideMsg:function(){
if(this.IDmsg){
var t=$(this.IDmsg);
if(t){
t.hide();
}
}
},addOnsParam:function(obj){
$extend(this.action.addOnsParam,obj);
},getInputPos:function(){
this._currentInputPos=$CursorPosition(this.getEl("input"));
},showEmotion:XN.func.empty,hideEmotion:XN.func.empty,_patchForNewUser:function(){
var _3a5=this.getEl("currentStatus");
var _3a6=this.getEl("updateTime");
if(_3a5&&_37e.isBlank(_3a5.innerHTML)){
_3a5.innerHTML=this.getTip("newUser");
if(_3a6){
_3a6.innerHTML="";
}
}
},_parseEmotionEvent:function(e){
var el=XN.EVENT.element(e);
if(el.tagName.toLowerCase()=="a"){
el=el.getElementsByTagName("img")[0];
}
if(el.tagName.toLowerCase()=="img"&&el.getAttribute("emotion")){
this.addEmotion(el.getAttribute("emotion"));
}
},_forSpecial:false,addEmotion:function(code,sp){
if(sp){
XN.Cookie.set(this.getConfig("spCookieName"),"1",10000,"/","."+XN.env.domain+"");
this._forSpecial=true;
}
var This=this;
if(this.forSpecial){
code=this.forSpecial(code);
}
var _3ac=this.getEl("input");
if(this.getTip("inputDefault")==_3ac.value){
_3ac.value="";
}
var pos=this._currentInputPos;
_3ac.value=_3ac.value.slice(0,pos.start)+code+_3ac.value.slice(pos.end);
_3ac.blur();
setTimeout(function(){
This._inputHelper.focus(pos.start+code.length);
},10);
},update:function(_3ae){
var _3af=XN.STRING.trim(_3ae);
if(this.getTip("inputDefault")==_3af){
this.fireEvent("updateError","\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001");
return;
}else{
if(_3af==""){
this.getEl("input").value="";
this.fireEvent("updateError",XN.APP.status.getError(3));
return;
}
}
var _3b0=this.getEl("currentStatus");
if(_3b0){
this._lastStatus=XN.STRING.trim(_3b0.innerHTML);
}
this.action.update(_3ae);
},_disableSubmit:function(){
this.getEl("submit").addClass("disabled");
this.getEl("submit").onclick=null;
this.getEl("input").disalbe=true;
},_enableSubmit:function(){
var This=this;
var _3b2=this.getEl("submit");
setTimeout(function(){
This.getEl("submit").delClass("disabled");
},1000);
_3b2.onclick=function(e){
XN.EVENT.stop(e||window.event);
This.fireEvent("beforeUpdate");
This.update(This.getEl("input").value);
};
this.getEl("input").disabled=false;
this.getEl("submit").disabled=false;
},_resetInput:function(){
var _3b4=this.getEl("input");
_3b4.value=this.getTip("inputDefault");
_3b4.style.color="#888";
_3b4.blur();
},advancedMode:function(){
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
if(this._uiType=="home"){
var _3b5=this.getEl("inputContent");
var _3b6=this.getEl("submit");
var _3b7=this.getEl("counter");
var _3b8=this.getEl("special");
if(_3b5){
_3b5.addClass("inputactve");
}
if(_3b6){
_3b6.show();
}
if(_3b7){
_3b7.show();
}
if(_3b8){
_3b8.hide();
}
}
this.showEmotion();
this.getEl("input").style.color="#333";
var _3b9=$("statusEdit");
if(_3b9){
_3b9.style.backgroundPosition="0 0";
}
this.fireEvent("advancedMode");
this._patchForIE();
},simpleMode:function(){
var This=this;
if(this._uiType=="home"){
var _3bb=this.getEl("inputContent");
var _3bc=this.getEl("counter");
var _3bd=this.getEl("special");
if(_3bb){
_3bb.delClass("inputactve");
}
if(this._uiType=="home"){
if(_3bc){
_3bc.hide();
}
}
if(_3bd&&(!this._forSpecial)){
_3bd.show();
}
}
var _3be=$("statusEdit");
if(_3be){
_3be.style.backgroundPosition="0 -58px";
}
this.hideEmotion();
this.fireEvent("simpleMode");
},_resetInputCounter:function(_3bf){
var _3c0=this.getEl("counter");
if(_3c0){
var v=this.getEl("input").value;
if(_3bf){
_3c0.innerHTML=0;
}
_3c0.delClass("full");
if(this._uiType=="home"){
_3c0.hide();
}
this.fireEvent("resetCounter");
}
},_onBlur:function(){
var This=this;
var _3c3=this.getEl("input");
$(_3c3).delClass("focus");
var v=_3c3.value;
if(v!==""&&v!=this.getTip("inputDefault")){
return;
}
if(this._overEmotion){
return;
}
This.simpleMode();
},_patchForIE:function(){
if(XN.BROWSER.IE7){
document.body.style.zoom=1.1;
document.body.style.zoom="";
}
},_onInputFocus:function(){
var _3c5=this.getEl("input");
if(_3c5.value==this.getTip("inputDefault")){
_3c5.value="";
}
this._resetInputCounter();
this.advancedMode();
$(_3c5).addClass("focus");
this.fireEvent("inputFocus");
},_beforePost:function(){
this._disableSubmit();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML="<img class=\"loading-img\" src=\""+XN.ENV.staticRoot+"img/upload_progress.gif\"/>\u66f4\u65b0\u4e2d\uff0c\u8bf7\u7a0d\u5019..";
}
},_onPostSuccess:function(r){
if(this._specialCode&&r.indexOf(this._specialCode)!==-1){
XN.COOKIE.set("sta1","1",10000);
}
this._enableSubmit();
this._resetInput();
this._resetInputCounter(true);
this.simpleMode();
var _3c7=this.getEl("updateTime");
if(_3c7){
_3c7.innerHTML=this.getTip("updateTime");
}
var _3c8=this.getEl("currentStatus");
if(_3c8){
_3c8.innerHTML=r;
_3c8.style.backgroundColor="rgb(255,255,150)";
setTimeout(function(){
XN.Effect.gradient(_3c8,255,255,150,function(){
_3c8.style.backgroundColor="transparent";
});
},50);
}
},_onPostError:function(r){
this._enableSubmit();
this.advancedMode();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML=this._lastStatus;
}
if(this.getEl("updateTime")){
this.getEl("updateTime").innerHTML="";
}
if(this.getConfig("showError")){
XN.DO.showError(r||this.getTip("onPostError"));
}
}};
XN.EVENT.enableCustomEvent(ns.editor.prototype);
})(XN.APP.status);
XN.dom.ready(function(){
var _3ca="(home|www|guide)\\."+XN.env.domain_reg;
if(!(window.asyncHTMLManager&&new RegExp("status."+XN.env.domain).test(window.asyncHTMLManager.location))&&new RegExp(_3ca).test(window.location.href+"")){
return;
}
if(!$("statusEdit")&&!$("publisher_statusInput")){
return;
}
var p={};
if(/status\.renren\.com/.test(window.location.href+"")){
XN.config.status.params="statusPage=1";
}
p.TIPinputDefault="\u4f60\u6b63\u5728\u5e72\u561b?";
var _3cc=new XN.APP.status.editor(p);
_3cc.forSpecial=function(code){
return code;
};
window.statusEditor=_3cc;
});
XN.dom.ready(function(){
if(!$("pageStatus")||!XN.BROWSER.IE){
return;
}
document.body.style.zoom=1.1;
document.body.style.zoom="";
});
(function(ns){
var _3cf=XN.STRING;
var _3d0=XN.EVENT.addEvent;
var _3d1;
var _3d2=true;
var lib;
function log(s){
if(_3d2){
XN.log(s);
}
}
ns.forPublisher=function(_3d5){
$extend(this,_3d5);
this.init();
};
ns.forPublisher.prototype={IDsubmit:"publisher_submit",IDinput:"publisher_statusInput",IDinputContent:"statusContent",IDcurrentStatus:"currentStatus",IDupdateTime:"statusUpdateTime",IDspecial:"commendStatus",IDemotion:"publisher_emotion",IDcounter:"publisher_count",IDtools:"publisher_tools",IDemobtn:"publisher_emobtn",IDcontainer:"status-publisher",IDuploadForm:"publisher_upload_form",TIPinputDefault:"\u4f60\u6b63\u5728\u5e72\u561b\uff1f",TIPinputPhoto:"\u8bf7\u6dfb\u52a0\u7167\u7247\u63cf\u8ff0...",TIPonPostError:"\u72b6\u6001\u66f4\u65b0\u5931\u8d25,\u8bf7\u5237\u65b0\u9875\u9762\u6216\u91cd\u65b0\u767b\u5f55",TIPupdateTime:"\u521a\u521a\u66f4\u65b0",TIPnewUser:"\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",TIPpublishing:"\u6b63\u5728\u53d1\u5e03, \u8bf7\u7a0d\u5019...",CFGshowError:true,CFGmaxLength:140,CFGspCookieName:"sta1",CFGinputMinHeight:28,CFGinputMaxHeight:50,CFGemoShow:true,_action:null,_lastStatus:null,getConfig:function(key){
return this["CFG"+key];
},getEl:function(id){
return $(this["ID"+id]);
},getTip:function(key){
return this["TIP"+key];
},init:function(){
var This=this,ac;
this.sbt=this.getEl("submit");
this.ipt=this.getEl("statusInput");
this.tools=$(this.IDtools);
this.emobtn=$(this.IDemobtn);
this.curStatus=$(this.IDcurrentStatus);
if(window.asyncHTMLManager&&XN.browser.IE&&!XN.user.isGuide){
this.CFGinputMinHeight=20;
}
if(Sizzle("#publisher_frame .publisher-highlight").length!=0){
this.CFGinputMinHeight=34;
if(XN.browser.IE){
this.CFGinputMinHeight=26;
}
}
this._action=ac=new XN.APP.status.updateAction({maxLength:this.getConfig("maxLength"),enableMedia:true});
ac.addEvent("beforePost",function(){
This._beforePost();
This.fireEvent("beforeUpdate");
});
ac.addEvent("postSuccess",function(r,text,json){
This._onPostSuccess(r,json);
This.fireEvent("updateSuccess");
});
ac.addEvent("postError",function(r){
This._onPostError(r);
This.fireEvent("updateError",r);
});
var _3df=this.getEl("input");
_3df.addEvent("focus",function(e){
This._onInputFocus(e);
},false);
_3df.addEvent("blur",function(e){
This._onBlur();
},false);
var _3e2=$element("div");
_3e2.id="publisher_counter_wrap";
_3e2.style.display="none";
_3e2.className="counter-new";
_3e2.innerHTML="<span id=\""+this.IDcounter+"\">0</span><span>/140</span>";
if($("publisher_upload_form")){
$("publisher_upload_form").appendChild(_3e2);
}
this.counter=_3e2;
this._inputHelper=new XN.FORM.inputHelper(this.getEl("input")).limit(this.getConfig("maxLength"),false).count(this.getEl("counter"),false).setDefaultValue(this.getTip("inputDefault"));
this._inputHelper.setDefaultValue(this.getTip("inputDefault"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
if(e.keyCode==13){
if(This.getEl("input").mention&&This.getEl("input").mention.selectorShow&&!This.getEl("input").mention.noMatch){
return;
}
This.getEl("input").blur();
if(This.mode=="keep"){
return true;
}
This.update(This.getEl("input").value);
}
});
this._enableSubmit();
if(this.getEl("emotion")){
this.getEl("emotion").addEvent("click",function(e){
e=e||window.event;
XN.EVENT.stop(e);
This._parseEmotionEvent(e);
}).addEvent("mouseover",function(e){
This._overEmotion=true;
}).addEvent("mouseleave",function(){
This._overEmotion=false;
}).addEvent("mousedown",function(e){
XN.EVENT.stop(e||window.event);
This.getInputPos();
});
}
if(this.getEl("special")){
this.getEl("special").addEvent("mousedown",function(){
This.getInputPos();
});
}
this.showEmotion=function(){
if(XN.widgets.publisher.currentTab){
return;
}
if(!this.getEl("emotion")){
return;
}
this.loadRealEmotion();
if(this.getConfig("emoShow")){
this.getEl("emotion").show();
}
};
this.loadRealEmotion=function(){
if(this.realEmoLoaded){
return;
}
var imgs=This.getEl("emotion").getElementsByTagName("img");
XN.array.each(imgs,function(i,v){
v.setAttribute("src",v.getAttribute("rsrc"));
v.removeAttribute("rsrc");
});
this.realEmoLoaded=true;
};
this.hideEmotion=function(){
XN.log("hideEmotion");
if(this.getEl("emotion")){
this.getEl("emotion").hide();
}
};
this.emobtn.addEvent("mouseover",function(e){
This._overEmotion=true;
});
this.emobtn.addEvent("mouseout",function(e){
This._overEmotion=false;
});
this.emobtn.addEvent("click",function(e){
e=e||window.event;
XN.event.stop(e);
This.showEmotion();
This._inputHelper.focus();
if(This.emobtn.hasClassName("pub-emtion-click")){
This.emobtn.delClass("pub-emtion-click");
This.hideEmotion();
}else{
This.emobtn.addClass("pub-emtion-click");
}
});
this.emoReset=function(){
This.hideEmotion();
This.emobtn.delClass("pub-emtion-click");
};
},_patchForNewUser:function(){
if("profile"==document.body.id){
return;
}
if(_3cf.isBlank(this.getEl("currentStatus").innerHTML)){
this.getEl("currentStatus").innerHTML=this.getTip("newUser");
this.getEl("updateTime").innerHTML="";
}
},_parseEmotionEvent:function(e){
var el=XN.EVENT.element(e);
if(el.tagName.toLowerCase()=="a"){
el=el.getElementsByTagName("img")[0];
}
if(el.tagName.toLowerCase()=="img"){
this.addEmotion(el.getAttribute("emotion"));
}
},getInputPos:function(){
this._currentInputPos=$CursorPosition(this.getEl("input"));
},_forSpecial:false,addEmotion:function(code,sp){
var This=this;
if(sp){
XN.Cookie.set(this.getConfig("spCookieName"),"1",10000,"/","."+XN.env.domain+"");
this._forSpecial=true;
}
if(this.forSpecial){
code=this.forSpecial(code);
}
var _3f2=this.getEl("input");
if(this.getTip("inputDefault")==_3f2.value){
_3f2.value="";
}
var pos=this._currentInputPos;
_3f2.value=_3f2.value.slice(0,pos.start)+code+_3f2.value.slice(pos.end);
_3f2.blur();
setTimeout(function(){
This._inputHelper.focus(pos.start+code.length);
},10);
},update:function(_3f4){
if(this.getTip("inputDefault")==_3f4){
return;
}
if(this.getEl("currentStatus")){
this._lastStatus=XN.string.trim(this.getEl("currentStatus").innerHTML);
}
this.hideEmotion();
if(this.emobtn){
this.emobtn.delClass("pub-emtion-click");
}
this.justStatus=XN.string.trim(_3f4);
this._action.update(_3f4);
},_disableSubmit:function(){
this.getEl("submit").onclick=null;
this.getEl("input").disalbe=true;
},_enableSubmit:function(){
var This=this;
var _3f6=this.getEl("submit");
_3f6.onclick=function(e){
if(This.mode=="keep"){
return true;
}
XN.EVENT.stop(e||window.event);
This.update(This.getEl("input").value);
};
this.getEl("input").disabled=false;
},_resetInput:function(){
var _3f8=this.getEl("input");
_3f8.value=this.getTip("inputDefault");
_3f8.style.color="#888";
},_effect:function(d){
var This=this;
var _3fb=this.getEl("input");
var mih=this.getConfig("inputMinHeight");
var mah=this.getConfig("inputMaxHeight");
if(this._aEffect){
this._aEffect.stop();
}
if(!this._aEffect){
this._aEffect=new XN.effect.Motion("easeOut",50);
}
if(d=="open"){
this._aEffect.onTweening=function(){
_3fb.style.height=this.equation(mih,mah)+"px";
};
this._aEffect.onComplete=function(){
This.showEmotion();
};
this._aEffect.start();
}else{
this._aEffect.onTweening=function(){
_3fb.style.height=this.equation(mah,mih)+"px";
};
this._aEffect.onComplete=null;
this._aEffect.start();
}
this.fireEvent("effectEnd");
},mode:"simple",advancedMode:function(){
if(this.mode=="advance"||this.mode=="keep"){
return;
}
this.mode="advance";
this.getEl("input").addClass("focus");
this._effect("open");
if(this.getEl("special")){
this.getEl("special").hide();
}
this.fireEvent("advancedMode");
},simpleMode:function(){
var This=this;
if(this.mode=="simple"||this.mode=="keep"||this.mode=="keepMode"){
return;
}
this.isShow=false;
this.mode="simple";
this._effect("close");
this.getEl("input").delClass("focus");
this._overEmotion=false;
if(this.getEl("special")&&(!this._forSpecial)){
this.getEl("special").show();
}
if(this.emobtn){
this.emobtn.delClass("pub-emtion-click");
}
this.hideEmotion();
this.fireEvent("simpleMode");
},_resetInputCounter:function(){
var _3ff=this.getEl("counter");
_3ff.innerHTML=this.getEl("input").value.length+"/"+this.getConfig("maxLength");
_3ff.delClass("full");
_3ff.hide();
this.fireEvent("resetCounter");
},_onBlur:function(){
var This=this;
var v=this.getEl("input").value;
if(v!==""&&v!=this.getTip("inputDefault")){
return;
}
if(this._overEmotion){
return;
}
if(this._overShare){
return;
}
this.curStatus.show();
This.simpleMode();
},_patchForIE:function(){
if(XN.BROWSER.IE){
document.body.style.zoom=1.1;
document.body.style.zoom="";
}
},_onInputFocus:function(){
var _402=this.getEl("input");
if(_402.value==this.getTip("inputDefault")||_402.value==this.getTip("inputPhoto")){
_402.value="";
}
this.advancedMode();
this.curStatus.hide();
_402.style.color="#333";
this.fireEvent("inputFocus");
},_beforePost:function(){
this._disableSubmit();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML="<img class=\"loading-img\" src=\""+XN.ENV.staticRoot+"img/upload_progress.gif\"/>\u66f4\u65b0\u4e2d\uff0c\u8bf7\u7a0d\u5019 ";
}
},_onPostSuccess:function(r,json){
this._enableSubmit();
this._resetInput();
var that=this;
setTimeout(function(){
that.mode="advance";
that.simpleMode();
that.getEl("input").blur();
},1000);
if(this.getEl("updateTime")){
this.getEl("updateTime").innerHTML=this.getTip("updateTime");
}
if(!this.getEl("currentStatus")){
return;
}
var _406=this.getEl("currentStatus");
_406.innerHTML="<a href=\"http://status."+XN.env.domain+"/getdoing.do?id="+XN.user.id+"\">\u521a\u521a\u66f4\u65b0: "+r+"</a>";
_406.title=this.justStatus;
_406.style.backgroundColor="rgb(255,255,150)";
_406.show();
this.tools.show();
setTimeout(function(){
XN.Effect.gradient(_406,255,255,150,function(){
_406.style.backgroundColor="transparent";
});
},50);
},noMoreThan:function(str,num){
if(str.length<=num){
return str;
}
return str.slice(0,num)+"...";
},_onPostError:function(r){
var This=this;
this._enableSubmit();
this.simpleMode();
this.getEl("currentStatus").innerHTML=this._lastStatus;
this.getEl("input").delClass("full");
if(this.getConfig("showError")){
XN.DO.showError(r||this.getTip("onPostError"));
setTimeout(function(){
This._inputHelper.focus();
},2100);
}else{
This._inputHelper.focus();
}
}};
XN.EVENT.enableCustomEvent(ns.forPublisher.prototype);
})(XN.app.status);
XN.namespace("widgets");
XN.widgets.publisher={IDtools:"publisher_tools",IDattach:"publisher_attach",IDshareVideo:"publisher_share_video",IDshareLink:"publisher_share_link",getID:function(id){
return "publisher_"+id;
},getEl:function(id){
return $(this.getID(id));
},hideEl:function(id){
this.getEl(id).style.display="none";
},inited:false,error:false,init:function(){
if(this.inited){
return;
}
this.inited=true;
this.attach=$(this.IDattach);
this.shareVideo=(this.IDshareVideo);
this.shareLink=(this.IDshareLink);
var This=this;
this.statusEditor=new XN.app.status.forPublisher({IDsubmit:this.getID("submit"),TIPinputDefault:XN.widgets.publisher.dDefaultValue||"\u4f60\u6b63\u5728\u5e72\u561b?"});
this.statusEditor.addEvent("advancedMode",function(){
This.open();
});
this.statusEditor.addEvent("simpleMode",function(){
This.close();
});
this.statusEditor.addEvent("updateSuccess",function(){
if(XN.jebe&&XN.jebe.refreshAd){
try{
XN.jebe.refreshAd(4);
}
catch(e){
}
}
if($(This.statusEditor.IDcounter)){
$(This.statusEditor.IDcounter).innerHTML=0;
}
This.attach&&This.attach.hide();
});
this.statusEditor.addEvent("updateError",function(r,msg,code){
if($(This.statusEditor.IDcounter)){
$(This.statusEditor.IDcounter).innerHTML=0;
}
});
if(Sizzle("#publisher_frame .publisher-highlight").length!=0){
$("publisher_statusInput").addEvent("focus",function(){
if(This.currentTab){
return;
}
$("publisher_counter_wrap").show();
}).addEvent("blur",function(){
if(XN.form.help($("publisher_statusInput")).getRealValue()==""){
$("publisher_counter_wrap").hide();
}
});
}
if(XN.browser.IE){
this.getEl("upload_form").onsubmit=function(){
This.submit();
return false;
};
}
this.getEl("submit").removeAttribute("disabled");
function stopEvent(e){
e=e||window.event;
XN.event.stop(e);
}
function enableEvent(e){
if(This.currentTab){
return;
}
}
this._tab={"uploading":{name:"uploading",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"publisher-loading\">\u6b63\u5728\u4e0a\u4f20\uff0c\u8bf7\u7a0d\u5019...</div>",isAttach:true,canSubmit:false},"attachPhoto":{name:"attachPhoto",title:"\u76f8\u518c",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"success\"><p>\u4e0a\u4f20\u6210\u529f\uff0c\u8bf7\u5b8c\u5584\u7167\u7247\u4fe1\u606f</p></div><div id=\"place_holder\"></div>",isAttach:false,canSubmit:"photo"},"uploadPhoto":{name:"uploadPhoto",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/retrieveUploadPhoto.do",canSubmit:"upload",cache:true},"uploadSuccess":{name:"uploadSuccess",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/photofeed.do",isAttach:true,canSubmit:false,cache:false},"publishing":{name:"publishing",title:"\u6b63\u5728\u53d1\u5e03",className:"publishing",html:"<div class=\"publisher-loading\" style=\"text-align:center;\">\u6b63\u5728\u53d1\u5e03\uff0c\u8bf7\u7a0d\u5019...</div>",icon:"http://s.xnimg.cn/a.gif",isAttach:true,canSubmit:false,cache:false},"shareLink":{name:"shareLink",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/retrieveShareLink.do",canSubmit:"share",cache:true},"postShare":{name:"postShare",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/save2share.do",canSubmit:false,cache:false},"emotion":{name:"emotion",title:"\u8868\u60c5",className:"",icon:"http://s.xnimg.cn/imgpro/icons/statusface/1.gif",url:"http://status."+XN.env.domain+"/publisher/showEmotion.do",canSubmit:"emotion",cache:true}};
XN.event.addEvent(this.getID("file"),"mousedown",stopEvent);
XN.event.addEvent(this.getID("file"),"mouseup",enableEvent);
var _414=[this.getID("file"),this.IDshareVideo,this.IDshareLink];
XN.event.addEvent(_414,"mouseover",function(){
This.statusEditor._overEmotion=true;
});
XN.event.addEvent(_414,"mouseout",function(){
This.statusEditor._overEmotion=false;
});
XN.event.addEvent(this.getID("file"),"change",function(e){
var v=This.getEl("file").value;
if(!/\.(png|jpg|jpeg|gif|bmp)/i.test(v)){
XN.DO.showError("\u8bf7\u9009\u62e9\u4e00\u5f20\u56fe\u7247");
return;
}
This.openTab(This._tab.uploading);
This.statusEditor.getEl("input").value;
This.statusEditor._inputHelper._defaultValue="";
This.statusEditor._inputHelper.element.value="";
This.getEl("upload_form").submit();
});
var tip=XN.dom.getElementsByClassName("status-tips-cion",this.getID("frame"))[0];
if(tip){
XN.event.addEvent(tip,"mousedown",stopEvent);
XN.event.addEvent(tip,"mouseup",enableEvent);
}
var _418=this.statusEditor.getEl("input");
var _419=$(This.IDtools);
var _41a=$(This.statusEditor.IDcurrentStatus);
_418.addEvent("focus",function(){
if(_419&&(!This.currentTab)){
_419.style.display="block";
}
});
_41a.addEvent("click",function(){
This.statusEditor._overEmotion=false;
});
if(_41a){
_41a.addEvent("mouseover",function(){
This.statusEditor._overEmotion=true;
});
_41a.addEvent("mouseout",function(){
This.statusEditor._overEmotion=false;
});
}
XN.event.addEvent(this.getID("share"),"mouseover",function(){
This.statusEditor._overShare=true;
});
XN.event.addEvent(this.getID("share"),"mouseout",function(){
This.statusEditor._overShare=false;
});
XN.event.addEvent([this.IDshareVideo,this.IDshareLink],"click",function(e){
This.statusEditor._inputHelper.focus();
if(!This._shareTip){
var _41c={bar:This.statusEditor.getEl("input"),alignType:"1-4",offsetY:-6,fireOn:"manual",msg:"\u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u5728\u8fd9\u91cc\u5206\u4eab\u5566\uff01"};
if(XN.browser.IE7){
}
This._shareTip=new XN.ui.tooltip(_41c);
}
This._shareTip.show();
This.statusEditor.CFGemoShow=false;
});
XN.event.addEvent(_418,"blur",function(){
This.statusEditor.CFGemoShow=true;
try{
This._shareTip.hide();
}
catch(e){
}
});
XN.event.addEvent(this.getID("action_close"),"click",function(e){
e=e||window.event;
XN.event.stop(e);
This.closeTab();
});
XN.event.addEvent(this.getID("action_content"),"click",function(e){
This.parseEvent(e||window.event);
});
XN.event.addEvent(this.getID("submit"),"click",function(e){
XN.event.stop(e||window.event);
This.submit();
});
XN.event.addEvent(this.statusEditor.getEl("input"),"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
if(This.statusEditor.getEl("input").mention&&This.statusEditor.getEl("input").mention.selectorShow&&!This.statusEditor.getEl("input").mention.noMatch){
return;
}
This.submit();
}
});
object.use("xn.mention",function(_421,xn){
xn.mention.Mention.init([{obj:This.statusEditor.getEl("input"),ugcId:"",ugcType:"status",ownerId:XN.user.id}]);
});
this.fireEvent("init");
XN.log("publisher:init over");
},submit:function(){
if(this.mode=="close"){
return;
}
if(this._submitDisabled){
return;
}
if(!this.currentTab){
return;
}
var cs=this.currentTab.canSubmit;
if(!cs){
return;
}
var This=this;
if(cs=="createAlbum"){
this.getEl("create_form").submit();
}else{
if(cs=="photoDesc"){
this.openTab(this._tab.updateDesc,"description="+encodeURIComponent(this.getEl("photo_description").value)+"&photoId="+this.getEl("photo_id").value);
}else{
if(cs=="share"){
var link=this.getEl("share_title").value;
if(!/^http:\/\//i.test(link)){
link="http://"+link;
}
var _426="weblink="+encodeURIComponent(link);
if(this.getEl("share_name")){
_426+="&title="+encodeURIComponent(this.getEl("share_name").value);
_426+="&fromname="+encodeURIComponent(this.getEl("share_fromname").value);
}else{
_426+="&fromname=";
}
var _427=this.statusEditor.getEl("input").value;
if(_427==this.statusEditor.getTip("inputDefault")){
_427="";
}
_426+="&status="+encodeURIComponent(_427);
_426+=XN.app.status.getForwardParam();
XN.app.status.setForwardNull();
this.openTab(this._tab.postShare,_426);
this.statusEditor.getEl("input").value="";
}else{
if(cs=="photo"){
var _427=$("photo-description").value;
if(_427==this.statusEditor.getTip("inputPhoto")){
_427="";
}
var sel=$("album");
var p={id:this._photoId,status:_427,albumSelect:sel.value};
if(_427.length>200){
XN.DO.showError("\u7167\u7247\u63cf\u8ff0\u6700\u591a\u53ea\u80fd\u8f93\u5165200\u5b57");
setTimeout(function(){
This.statusEditor._inputHelper.focus();
},2000);
return;
}
var that=this;
XN.element.addClass("publisher_frame","publishing");
that.openTab(that._tab.uploadSuccess,XN.array.toQueryString(p)+XN.app.status.getForwardParam());
XN.app.status.setForwardNull();
that.statusEditor.getEl("input").value="";
$("publisher_action_content").innerHTML="<div class=\"photo-uploading\">"+This.statusEditor.getTip("publishing")+"</div>";
}else{
if(cs=="emotion"){
this.statusEditor.update(this.statusEditor.getEl("input").value);
this.closeTab();
}
}
}
}
}
this.fireEvent("submit",this.currentTab);
},parseEvent:function(e){
},openEffect:function(_42c,_42d,end,func){
_42c.style.display="block";
var _430=this.getEl("patch_iframe");
var _431=this.getEl("frame");
if(this._frameEffect){
this._frameEffect.stop();
}
if(!this._frameEffect){
this._frameEffect=new XN.effect.Motion("easeOut",50);
}
this._frameEffect.onTweening=function(){
_42c.style.height=this.equation(_42d,end)+"px";
if(_430){
_430.style.height=_431.offsetHeight+"px";
}
};
this._frameEffect.onComplete=function(){
_42c.style.height="auto";
};
this._frameEffect.start();
},buttonEffect:function(_432,end){
},_tabEffect:function(tab){
var This=this;
var _436=this.getEl("action_title");
if(this._titleEffect){
this._titleEffect.stop();
}
if(!this._titleEffect){
this._titleEffect=new XN.effect.Motion("easeOut",50);
}
this._titleEffect.onTweening=function(){
_436.style.left=this.equation(200,10)+"px";
};
this._titleEffect.start();
if(tab.name=="attachPhoto"){
this.buttonEffect(this.getEl("submit").offsetTop,this.getEl("action_rframe").offsetHeight-this.getEl("submit").offsetHeight);
}else{
if(!(tab.name==="uploading")){
setTimeout(function(){
var _437=30+This.getEl("action_rframe").offsetHeight;
This.buttonEffect(This.getEl("submit").offsetTop,_437);
},0);
}
}
this.openEffect(this.getEl("action_frame"),this.getEl("action_frame").offsetHeight,this.getEl("action_rframe").offsetHeight+10);
},startLoading:function(){
this.getEl("action_content").addClass("loading");
this.getEl("action_content").clear();
this.isLoading=true;
},stopLoading:function(){
this.getEl("action_content").delClass("loading");
this.isLoading=false;
},disableSubmit:function(){
this._submitDisabled=true;
this.getEl("submit").addClass("disabled");
this.getEl("submit").setAttribute("disabled","disabled");
},enableSubmit:function(){
this._submitDisabled=false;
this.getEl("submit").delClass("disabled");
this.getEl("submit").removeAttribute("disabled");
},_startCheckSubmit:function(){
var This=this;
this._stopCheckSubmit();
var cs=This.currentTab.canSubmit;
if(!cs){
return;
}
var _43a=null;
if(cs=="share"){
_43a=function(){
var v=This.getEl("share_title").value;
if(XN.string.isBlank(v)){
return true;
}
if(v=="\u8bf7\u8f93\u5165\u7f51\u5740/\u89c6\u9891\u5730\u5740/\u97f3\u9891\u5730\u5740"){
return true;
}
if(v=="http://"){
return true;
}
if(!/^[a-zA-Z]/.test(v)){
return true;
}
if(!/[a-zA-Z0-9]\.[a-zA-Z0-9]/.test(v)){
return true;
}
return false;
};
}else{
if(cs=="createAlbum"){
_43a=function(){
return XN.string.isBlank(This.getEl("album_title").value);
};
}else{
if(cs=="photoDesc"){
_43a=function(){
return XN.string.isBlank(This.getEl("photo_description").value);
};
}else{
if(cs=="photo"){
_43a=function(){
return false;
};
}else{
if(cs=="emotion"){
_43a=function(){
return false;
};
}
}
}
}
}
this._submitTimer=setInterval(function(){
if(_43a&&_43a()){
This.disableSubmit();
}else{
This.enableSubmit();
}
},200);
},_stopCheckSubmit:function(){
if(this._submitTimer){
clearInterval(this._submitTimer);
this._submitTimer=null;
}
},mode:"open",canClose:true,closeTab:function(){
var tab=this.currentTab;
var temp=this.getEl("statusInput");
this.fireEvent("beforeTabClose",{currentTab:tab,input:temp});
var that=this;
if(tab&&(tab.name=="attachPhoto")){
if($("album").value||temp.value&&temp.value!=this.statusEditor.getTip("inputPhoto")){
XN.DO.confirm({message:"\u786e\u5b9a\u4e0d\u53d1\u5e03\u8be5\u7167\u7247\u5417\uff1f\u4f60\u7684\u597d\u53cb\u5c06\u4e0d\u4f1a\u6536\u5230\u8be5\u7167\u7247\u7684\u65b0\u9c9c\u4e8b\u3002",title:"\u63d0\u793a",submit:"\u4e0d\u53d1\u5e03",callBack:function(yes){
if(!yes){
}else{
that.getEl("statusInput").value="";
that._closeTab();
}
}});
return;
}else{
that._closeTab();
return;
}
}
this._closeTab();
},_closeTab:function(){
if(this.currentTab&&this.currentTab.pre){
this.openTab(this._tab[this.currentTab.pre]);
return;
}
var This=this;
this.statusEditor.mode="advance";
this.getEl("submit").style.top="0";
this.getEl("submit").show();
this.getEl("tools").style.display="block";
this.hideEl("action_frame");
this.attach.hide();
this.statusEditor.getEl("input").show();
this.statusEditor.getEl("input").show();
this._stopCheckSubmit();
this.enableSubmit();
var val=this.getEl("statusInput").value;
this.getEl("upload_form").reset();
this.getEl("statusInput").value=val;
if(this.currentTab&&this.currentTab.name=="attachPhoto"){
}else{
this.currentTab=null;
}
this.currentTab=null;
this.mode="close";
$("publisher_frame").className="publisher";
$("publisher_submit").show();
$("currentStatus").show();
if($(this.statusEditor.IDcounter)){
$(this.statusEditor.IDcounter).innerHTML=0;
}
this.statusEditor._inputHelper.setDefaultValue(this.statusEditor.getTip("inputDefault"));
$("publisher_upload_form").delClass("no-spacing");
this.error=false;
setTimeout(function(){
var se=This.statusEditor;
se.simpleMode();
$("publisher_submit").style.top="0";
se._inputHelper._default=false;
se._inputHelper.setDefaultValue(se.TIPinputDefault);
This.fireEvent("afterTabClose");
},100);
},openTab:function(tab,_444){
var This=this;
if(this.foldTimer){
clearTimeout(this.foldTimer);
}
this.statusEditor.mode="keep";
this.statusEditor.hideEmotion();
this.currentTab=tab;
this.getEl("action_frame").show();
this.getEl("action_title").innerHTML=tab.title;
this.getEl("action_title_img").className=tab.className+" icon";
this.getEl("action_title_img").src=tab.icon;
this.getEl("tools").hide();
this.statusEditor.getEl("input").blur();
this.disableSubmit();
this._stopCheckSubmit();
if(tab.url){
this.loadAction(tab.url+(_444?"?"+_444:""));
this.startLoading();
}
if(tab.html){
this.renderTab(tab.html);
}
this._tabEffect(tab);
this.mode="open";
},renderTab:function(html){
var This=this;
This.getEl("action_content").innerHTML=html;
if(this.currentTab.isAttach){
this.getEl("action_close").style.visibility="hidden";
}else{
this.getEl("action_close").style.visibility="inherit";
}
if(This.currentTab.focus){
setTimeout(function(){
var _448=This.getEl(This.currentTab.focus);
_448.focus();
_448.select();
},0);
}
if(this.currentTab.title=="\u8868\u60c5"){
var el=this.getEl("action_content").getElementsByTagName("ul")[0];
XN.event.addEvent(el,"click",function(e){
This.statusEditor._parseEmotionEvent(e||window.event);
});
XN.event.addEvent(el,"mousedown",function(e){
XN.event.stop(e||window.event);
This.statusEditor.getInputPos();
});
}
if(this.currentTab.title=="\u4e0a\u4f20"){
var _tt=$("publisher_frame");
XN.element.addClass(_tt,"photo-upload");
XN.element.addClass("publisher_upload_form","no-spacing");
$("publisher_statusInput").hide();
_tt=$("publisher_action_rframe");
$("publisher_submit").hide();
if($("publisher_counter_wrap")){
$("publisher_counter_wrap").hide();
}
}
if(this.currentTab.name){
if(this.currentTab.name=="uploadSuccess"||this.currentTab.name=="postShare"){
this.foldTimer=setTimeout(function(){
This.closeTab();
$("publisher_statusInput").blur();
},2000);
XN.element.delClass("publisher_frame","attach-sus");
var s=$("h_status");
if(s&&!XN.string.isBlank(s.value)){
this.statusEditor.getEl("currentStatus").innerHTML="<a href=\"http://status."+XN.env.domain+"/getdoing.do?id="+XN.user.id+"\">\u521a\u521a\u66f4\u65b0: "+XN.string.escapeHTML(s.value)+"</a>";
}
if(this.currentTab.name=="uploadSuccess"){
XN.element.addClass("publisher_frame","up-sus");
}
}
if(This.currentTab.name=="attachPhoto"){
This.statusEditor.getEl("input").show();
This.statusEditor.getEl("submit").show();
$("publisher_action_close").show();
$("publisher_statusInput").hide();
}
if(This.currentTab.name=="uploading"){
XN.debug.log("uploading");
}
if(This.currentTab.name=="shareLink"){
_tt=$("publisher_action_rframe");
$(_tt.getElementsByTagName("h4")[0]).show();
_tt=$("publisher_action_close").show();
XN.element.addClass("publisher_frame","shareLink");
}
XN.app.status.fireEvent("postSuccess","","",{allMsg:""});
}
if(!this.currentTab.name&&this.currentTab.name=="uploading"){
This.buttonEffect(This.getEl("submit").offsetTop,25+This.getEl("action_rframe").offsetHeight);
}
This.openEffect(This.getEl("action_frame"),This.getEl("action_frame").offsetHeight,This.getEl("action_rframe").offsetHeight+10);
This._startCheckSubmit();
this.fireEvent("tabOpen",this.currentTab);
},loadAction:function(link){
if(this.isLoading){
return;
}
var This=this;
new XN.net.xmlhttp({url:link,useCache:this.currentTab.cache,onComplete:function(){
This.stopLoading();
},onSuccess:function(r){
This.renderTab(r.responseText);
},onError:function(){
err();
}});
function err(){
XN.DO.showError("\u7f51\u7edc\u51fa\u9519, \u8bf7\u91cd\u8bd5...");
setTimeout(function(){
This.closeTab(This.currentTab);
},2000);
This.error=true;
}
},extend:false,open:function(){
if(this.extend){
return;
}
this.extend=true;
this.getEl("frame").delClass("status-main");
this.getEl("frame").addClass("status-main-background");
this.attach.show();
},close:function(){
if(!this.extend){
return;
}
this.extend=false;
var This=this;
This.getEl("frame").delClass("status-main-background");
This.getEl("frame").addClass("status-main");
this.attach.hide();
},onBeforeUpload:function(){
this.getEl("upload_iframe").hide();
var _452=$element("div");
_452.addClass("publisher-loading");
_452.innerHTML="\u6b63\u5728\u4e0a\u4f20....";
this.getEl("action_content").appendChild(_452);
},onUploadSuccess:function(code,url,msg,pid){
if(code!=0){
XN.DO.showError(msg);
this.error=true;
this.closeTab();
return;
}
this._photoId=pid;
var regx=/(<div id="place_holder">)(<\/div>)/;
var html=this._tab.attachPhoto.html;
var that=this;
new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/publisher/getAlbumAjax.do",onSuccess:function(r){
that._tab.attachPhoto.html=html.replace(regx,"$1"+r.responseText+"$2");
that.openTab(that._tab.attachPhoto);
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u51fa\u9519, \u8bf7\u91cd\u8bd5...");
setTimeout(function(){
that.closeTab(that.currentTab);
},2000);
that.error=true;
}});
},showPhotoDesc:function(url,pid){
this.openTab(this._tab.photoDesc,"url="+encodeURIComponent(url)+"&photoId="+pid);
}};
XN.event.enableCustomEvent(XN.widgets.publisher);
XN.dom.ready(function(){
var loc=window.location.href+"";
if(window.asyncHTMLManager){
loc=window.asyncHTMLManager.location.href;
}
var _45e="(home|www|guide)\\."+XN.env.domain_reg;
if(!new RegExp(_45e).test(loc)){
return;
}
if(!$("publisher_statusInput")){
return;
}
if(loc.indexOf("/status/")!=-1){
return;
}
XN.config.status.params="isAtHome=1";
XN.widgets.publisher.init();
XN.APP.status.replyEditor.prototype.slideUp=true;
});
(function(ns){
var isIE=XN.browser.IE;
function getPasteContent(p1,p2,s,l){
p1=p1.start;
p2=p2.start;
return l.substring(p1,p2);
}
ns.bindPaste=function(obj){
var args={before:XN.func.empty,after:XN.func.empty,callBack:XN.func.empty};
$extend(args,obj);
var _467=$(obj.element);
var _468=_467.value;
var _469={start:0};
XN.event.addEvent(_467,"focus",function(){
var _46a=XN.form.help(_467);
_469=_46a.cursorPosition();
if(_46a&&!_46a.getRealValue()){
_469.start=0;
_469.end=0;
}
});
var i=0;
var _46c=setInterval(function(){
var v=_467.value;
try{
if(v!==_468){
var cPos=XN.form.help(_467).cursorPosition();
var _46f=getPasteContent(_469,cPos,_468,v);
if(_46f.length<6){
return;
}
XN.log("XN.event.bindPaste:\u7c98\u8d34\u4e86\u5185\u5bb9");
XN.log(_46f);
XN.log(_469);
XN.log(cPos);
args.callBack.call(_467,_46f,_469,cPos,_468,v);
}
_468=v;
_469=XN.form.help(_467).cursorPosition();
}
catch(e){
}
},200);
};
})(XN.event);
(function(_470){
var _471=function(_472){
var This=this;
var pos=0;
var _475=_472.length;
this.image=function(){
return _472[pos];
};
this.next=function(){
if(this.cn()){
pos++;
}
return This.image();
};
this.pre=function(){
if(this.cp()){
pos--;
}
return This.image();
};
this.cn=function(){
return pos<_475-1;
};
this.cp=function(){
return pos>0;
};
this.pos=function(){
return pos+1;
};
this.length=function(){
return _475;
};
};
_470.pasteParser={urls:[],isAdded:function(url){
return XN.array.include(this.urls,url);
},init:function(){
var This=this;
XN.event.bindPaste({element:_470.statusEditor.getEl("input"),callBack:function(_478){
This.parseShare(_478);
}});
},initShareTab:function(){
},parseShare:function(p){
var This=this;
if(!XN.string.isUrl(p)){
XN.log("\u7c98\u8d34\u7684\u5185\u5bb9\u4e0d\u662furl");
}else{
if(/renren\.com|kaixin\.com/.test(p)){
XN.log("\u4e0d\u652f\u6301\u7ad9\u5185\u5206\u4eab");
return;
}
if(_470.currentTab&&_470.currentTab.name!="shareLink"){
XN.log("\u5f53\u524d\u5df2\u7ecf\u6253\u5f00\u975e\u5206\u4eabtab\uff0c\u8fd4\u56de");
return;
}
_470.startLoading();
new XN.net.xmlhttp({url:"http://share."+XN.env.domain+"/parse_share.do",data:"link="+encodeURIComponent(p),method:"get",onComplete:function(){
_470.stopLoading();
$("publisher_counter_wrap").hide();
},onSuccess:function(r){
This.renderTab(XN.json.parse(r.responseText));
}});
}
},renderTab:function(json){
if(json.code!==0){
_470.closeTab();
return;
}
$(_470.getEl("action_title").parentNode).show();
XN.log("publisher\u4e2d\u5206\u4eab\u89e3\u6790\u7ed3\u679c:");
XN.log(json);
json.description=json.description||"";
var tab={name:"fastShare",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",canSubmit:"fastShare"};
var html="";
if(json.type==11){
html=["<div class=\"share-publisher\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p><input id=\"publisher_fromname\" onfocus=\"this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.border='1px solid #fff';\" type=\"text\" style=\"border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\"\u672a\u77e5\u827a\u672f\u5bb6\"/></p>","<p class=\"description\">"+json.link+"</p>","</div>"].join("");
}else{
if(json.type==6){
json.images=json.images||[];
this.shareScroll=new _471(json.images);
html=["<div class=\"share-publisher\">","<div class=\"figure\">","<img width=\"100\" onerror=\"this.src='http://xnimg.cn/imgpro/bg/default-pic.png'\" id=\"publisher_share_thumb_img\" src=\""+(this.shareScroll.image()||"javascript:void(0);")+"\">","</div>","<div id=\"publisher_share_ar\" "+(this.shareScroll.length()==0?"style=\"margin-left:0px;\"":"")+"class=\"article\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p class=\"description\">"+(json.description||json.link)+"</p>","<div "+((this.shareScroll.length()==0||/\.(jpg|jpeg|gif|png)$/i.test(json.link))?"style=\"display:none;\"":"")+" class=\"nav\">","<div id=\"publisher_share_inav\" class=\"fore-next no-fore "+(this.shareScroll.length()==1?"no-next":"")+"\">","<a class=\"fore\" onclick=\"var s=XN.widgets.publisher.pasteParser.shareScroll;var p = $(this.parentNode);if(s.cp()){$('publisher_share_thumb_img').src=$('publisher_share_thumb').value=s.pre();if(s.cp()){p.delClass('no-fore');}else{p.addClass('no-fore');}if(s.cn()){p.delClass('no-next');}else{p.addClass('no-next');}}$('publisher_share_thumb_num').innerHTML=s.pos();\"href=\"javascript:;\">\u4e0a\u4e00\u5f20</a>"," <a class=\"next\" href=\"javascript:;\" onclick=\"var s=XN.widgets.publisher.pasteParser.shareScroll;var p = $(this.parentNode);if(s.cn()){$('publisher_share_thumb_img').src=$('publisher_share_thumb').value=s.next();if(s.cp()){p.delClass('no-fore');}else{p.addClass('no-fore');}if(s.cn()){p.delClass('no-next');}else{p.addClass('no-next');}}$('publisher_share_thumb_num').innerHTML=s.pos();this.style.zoom=1.1;this.style.zoom=1;\">\u4e0b\u4e00\u5f20</a>","<p>&nbsp;<span id=\"publisher_share_thumb_num\">1</span>/"+this.shareScroll.length()+" <span class=\"description\">\u9009\u62e9\u4e00\u4e2a\u7f29\u7565\u56fe</span></p>","<input type=\"hidden\" id=\"publisher_share_thumb\" value=\""+this.shareScroll.image()+"\" />","</div>","<p><label><input onclick=\"var This = this;var nav = $('publisher_share_inav');var img = $('publisher_share_thumb_img');var ar =$('publisher_share_ar');setTimeout(function(){if(!This.checked){img.show();nav.show();ar.style.marginLeft='110px';}else{img.hide();nav.hide();ar.style.marginLeft='0px';}},0);\" id=\"publisher_share_nothumb\" name=\"noThumb\" value=\"true\" type=\"checkbox\"> \u4e0d\u52a0\u7f29\u7565\u56fe</label></p>","</div>","</div>","</div>"].join("");
}else{
if(json.type==10){
html=["<div class=\"share-publisher\">","<div class=\"figure\">","<img width=\"100px\" id=\"publisher_share_thumb_img\" src=\""+json.pic+"\">","</div>","<div class=\"article\" style=\"height:100px;\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p class=\"description\">"+json.link+"</p>","</div>","</div>"].join("");
}
}
}
tab.html=html;
this.currentTab=tab;
this.postData=json;
_470.openTab(tab);
_470.getEl("action_close").show();
},submit:function(tab){
var This=this;
if(tab!==this.currentTab&&tab.canSubmit!="pasteShareURI"){
XN.log("\u4e0d\u662f\u7c98\u8d34\u5206\u4eabtab,\u4e0d\u6267\u884c\u5206\u4eab\u63d0\u4ea4");
return;
}
if(tab.canSubmit==="pasteShareURI"){
this.parseShare($("publisher_share_title").value);
return;
}
var data=$extend({albumid:"0",fromname:"",fromno:"0",fromuniv:"",largeurl:"",link:"",pic:"",title:"",summary:"",type:""},this.postData);
delete data.code;
data["title"]=$("publisher_link_title").value;
if(data.images){
delete data.images;
}
if($("publisher_share_thumb")&&!$("publisher_share_nothumb").checked){
data["pic"]=$("publisher_share_thumb").value;
}
if(data.type==11){
var _482=$("publisher_fromname").value;
if(_482!="\u672a\u77e5\u827a\u672f\u5bb6"){
data["fromname"]=_482;
}
}
if(data.type==6){
data.summary=data.description;
delete data.description;
}
data["action"]="add";
data["auth"]="99";
var _483=XN.string.trim(_470.statusEditor.getEl("input").value);
var regx=/@\S+\(\d+\)$/;
if(regx.test(_483)){
_483+=" ";
}
if(_483==_470.statusEditor.getTip("inputDefault")){
_483="";
}
if(_483==data.link){
data["body"]="";
}else{
data["body"]=_483;
}
_470.startLoading();
var _485=$("publisher_form_ticket");
if(_485){
this._tsc=_485.value;
}
new XN.net.xmlhttp({url:"http://share."+XN.env.domain+"/share/submit.do",data:"post="+encodeURIComponent(XN.json.build(data))+"&tsc="+this._tsc,onComplete:function(){
_470.stopLoading();
},onSuccess:function(r){
_470.statusEditor.getEl("input").value="";
setTimeout(function(){
_470.closeTab();
},2000);
var j=XN.json.parse(r.responseText);
if(j.status===0){
This.success("\u5206\u4eab\u6210\u529f!");
}else{
This.error(j.msg);
}
},onError:function(){
_470.closeTab();
}});
},success:function(msg){
_470.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"success\"><p>"+msg+"</p></div>",canSubmit:false});
},error:function(msg){
_470.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"fail\"><p>"+msg+"</p></div>",canSubmit:false});
},loading:function(msg){
msg=msg||"\u8bf7\u7a0d\u5019...";
_470.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"loading\"></div>",canSubmit:false});
}};
})(XN.widgets.publisher);
XN.widgets.publisher.addEvent("init",function(){
XN.log("publisher \u7c98\u8d34url\u89e3\u6790\u521d\u59cb\u5316\u5f00\u59cb");
this.pasteParser.init();
XN.log("publisher \u7c98\u8d34url\u89e3\u6790\u521d\u59cb\u5316\u7ed3\u675f");
});
XN.widgets.publisher.addEvent("submit",function(tab){
this.pasteParser.submit(tab);
});
XN.namespace("ui.tooltip");
XN.ui.tooltip=function(_48c){
if(_48c){
$extend(this,_48c);
}
this.init();
};
XN.ui.tooltip.ids=0;
XN.ui.tooltip.prototype={init:function(){
var that=this;
var div=$element("div");
div.id="tooltip_"+XN.ui.tooltip.ids++;
var ds=div.style;
ds.background="#fff9d7";
ds.border="solid 1px #d7b013";
ds.padding="3px 15px 3px 3px";
div.innerHTML=this.msg||"";
var a=$element("a");
var as=a.style;
a.className="x-to-hide";
as.position="absolute";
as.top="0";
as.right="0";
as.cursor="pointer";
if(this.cookie){
var c=this.cookie;
XN.event.addEvent(a,"click",function(e){
e=e||window.event;
XN.event.stop(e);
XN.cookie.set(c.key,c.value,c.expire||10000);
that.tip.hide();
});
}
var _494=$element("div");
var das=_494.style;
das.background="url(http://s.xnimg.cn/imgpro/arrow/tip-arrow-down.png?ver=2) no-repeat";
das.height="6px";
das.width="11px";
das.position="absolute";
das.bottom="-6px";
if(XN.browser.IE6){
das.bottom="-14px";
}
das.left="16px";
div.appendChild(_494);
div.appendChild(a);
this.menu=div;
this.tip=new XN.ui.menu(this);
},show:function(){
this.tip.show();
},hide:function(){
this.tip.hide();
}};
(function(ns){
var ecd=function(str){
return encodeURIComponent(str);
};
var dcd=function(str){
return decodeURIComponent(str);
};
var $=xn_getEl;
var _49c={};
getReplyEditor=function(idx,_49e){
return _49c[_49e+idx];
};
delReplyEditor=function(idx,_4a0){
delete _49c[_4a0+idx];
};
var _ac=new XN.APP.status.updateAction();
ns.replyEditor=function(_4a2){
this.config=this.config||{};
this.ac=_ac;
$extend(this.config,{loadReplyURI:"/doing/getReply.do",sendReplyURI:"/doing/reply.do",delReplyURI:"/doing/deleteReply.do",maxlength:240,showMore:true,fwdThis:false,enableShare:false,shareThis:false});
$extend(this.config,_4a2);
if(this.config.feedType=="status"){
this.config.maxlength=240;
}else{
this.config.maxlength=140;
}
_49c[this.getConfig("delFlag")+this.getConfig("idx")]=this;
this.xinit();
};
ns.replyEditor.prototype={_tips:{loadError:"\u52a0\u8f7d\u56de\u590d\u5931\u8d25",replyError:"\u56de\u590d\u5931\u8d25",deleteConfirm:"\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u56de\u590d?",deleteError:"\u5220\u9664\u56de\u590d\u5931\u8d25",inputTip:"\u6dfb\u52a0\u56de\u590d",sending:"\u6b63\u5728\u53d1\u9001..."},_tscCode:null,_replyData:null,_replyRequest:null,_replyCount:null,_showMore:false,_hasLoadAll:false,isProfile:function(){
return "profile"==document.body.id;
},xinit:function(){
},abortRequest:function(){
try{
this._replyRequest.abort();
}
catch(e){
}
},getTip:function(key){
return this._tips[key];
},getConfig:function(key){
if(key=="idx"){
return this.config["doingId"];
}
return this.config[String(key)];
},getEl:function(id){
if(id=="feedbody"){
return $(this.getID("feedbody"))||$(this.getID("replyfordoing"));
}
return $(this.getID(id));
},getID:function(id){
if(this.getConfig("delFlag")=="p"||/^album/.test(this.getConfig("delFlag"))){
return id+"_"+this.getConfig("delFlag")+"_"+this.getConfig("idx");
}
return id+this.getConfig("idx");
},canDel:function(){
return this._canDel;
},isHostId:function(id){
return parseInt(this.getConfig("hostId"))==parseInt(id);
},replyMode:"none",replyTo:function(sid,uid,_4aa){
_4aa=dcd(_4aa);
this.clearReply();
this.replyMode="one";
this._replyData={sid:sid,uid:uid,uname:_4aa};
var _4ab=this.getEl("input");
var _4ac=_4ab.value;
var role="";
if(XN.page&&XN.page.data&&XN.page.data.type==5&&XN.page.data.isAdmin&&XN.user&&XN.user.name){
role="\u3010"+XN.user.name+"\u3011";
_4ac="";
}
this._replyPrefix=role+"\u56de\u590d"+XN.string.unescapeHTML(_4aa)+"\uff1a ";
_4ab.value=_4ac.indexOf("\u56de\u590d")==0?this._replyPrefix:this._replyPrefix+_4ac;
this._inputHelper.focus();
this.saveInputPos();
},replyToAll:function(){
var _4ae=this.getEl("input");
this.replyMode="all";
this.stripReply();
this._replyPrefix="\u56de\u590d\u5927\u5bb6: ";
_4ae.value=this._replyPreifx+_4ae.value;
this._inputHelper.focus();
this._replyData={toAll:true};
},stripReply:function(){
var _4af=this.getEl("input");
var v=_4af.value;
if(this._replyPrefix){
v=v.replace(this._replyPrefix,"");
}
_4af.value=v.replace(new RegExp("^\u6dfb\u52a0\u56de\u590d"),"");
},clearReply:function(){
this.replyMode="none";
this.stripReply();
this._replyData=null;
},updateReplyCounter:function(){
var c1=this.getEl("counter_m");
if(c1){
c1.innerHTML=this._replyCount;
}
var c2=this.getEl("replyCount");
if(c2){
c2.innerHTML=this._replyCount;
}
},sendReply:function(){
var This=this;
reply=this.getEl("input").value;
if(reply==this.getTip("inputTip")){
return;
}
if(XN.STRING.isBlank(reply)){
XN.DO.showError("\u8f93\u5165\u4e0d\u80fd\u4e3a\u7a7a");
return;
}
if(reply.length>this.getConfig("maxlength")){
XN.DO.showError("\u6700\u591a\u53ea\u80fd\u8f93\u5165"+this.getConfig("maxlength")+"\u4e2a\u5b57\u7b26");
return;
}
var _4b4={};
_4b4["source"]=this.getConfig("ugcSource")||this.getConfig("doingId");
_4b4["doingId"]=this.getConfig("shareId");
_4b4["owner"]=this.getConfig("ownerId");
_4b4["feedId"]=this.getConfig("feedId")||"";
if(this.getConfig("fromId")){
_4b4["fromId"]=this.getConfig("fromId");
}
if(this.getConfig("type")){
_4b4["t"]=this.getConfig("type");
}
if(this._replyData){
if(this._replyData.toAll){
_4b4["replayAllUser"]=1;
if(!new RegExp("^\u56de\u590d\u5927\u5bb6:").test(reply)&&reply.length+6<=this.getConfig("maxlength")){
reply="\u56de\u590d\u5927\u5bb6: "+reply;
}
}else{
_4b4["rpLayer"]="1";
_4b4["replyTo"]=this._replyData["uid"];
_4b4["replyName"]=this._replyData["uname"];
_4b4["secondaryReplyId"]=this._replyData["sid"];
}
}else{
_4b4["rpLayer"]="0";
}
_4b4["c"]=reply;
this.ajaxSendAction(_4b4);
},ajaxSendAction:function(_4b5){
var that=this;
var This=this;
this.preventDbclick();
this.fireEvent("beforePost",this._replyData,this);
this._replyRequest=new XN.NET.xmlhttp({url:this.getConfig("sendReplyURI"),data:XN.ARRAY.toQueryString(_4b5),onSuccess:function(r){
var str=r.responseText;
if(!str||str=="empty"){
return;
}
var rt=XN.JSON.parse(str);
if(rt.code==0){
that._onReplySuccess(rt);
}else{
if(rt.code==15){
that.resetInput();
that.simpleMode();
return;
}else{
var _4bb=that.getConfig("type")=="page";
if(_4bb){
var _4bc=that.getConfig("commentType")=="blog";
var _4bd=that.getConfig("commentType")=="album";
if(_4bc||_4bd){
that._onReplyError(rt.msg||(XN.APP.status.getError(rt.code)||"\u670d\u52a1\u5668\u7e41\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01"));
return;
}
}
that._onReplyError(XN.APP.status.getError(rt.code)||rt.msg);
}
}
if(This.fwdThis){
This.fwdThisStatus(_4b5["c"]);
}
if(This.shareThis){
This.shareThisugc(_4b5["c"]);
}
},onError:function(){
that._onReplyError(that.getTip("replyError"));
}});
},fwdThisStatus:function(_4be){
var This=this;
var _4c0=this.getConfig("doingId");
var _4c1=this.config["ownerid"]||this.getConfig("ownerId");
var type="status";
fwdmgr.fowardThis(_4c0,_4c1,type,function(r){
var rt=XN.json.parse(r.responseText);
var _4c5="\u8f6c\u81ea";
if(rt.fwdRootStatus===undefined){
_4c5+=rt.userName;
}else{
_4c5+=(rt.userName+": "+rt.statusContent);
}
_4c5=_4be+_4c5;
if(_4c5.length>This.config.maxlength){
_4c5=_4c5.slice(0,(This.config.maxlength-3))+"...";
}
XN.APP.status.setForwardTrue(_4c0,_4c1,type);
setTimeout(function(){
This.ac.update(_4c5);
},3000);
});
},shareThisugc:function(_4c6){
var This=this;
var _4c8=this.getConfig("doingId");
var _4c9=this.getConfig("ownerid");
var post={"action":"add","auth":99,"body":encodeURIComponent(XN.string.ltrim(_4c6))};
if(This.config["feedType"]&&This.config["feedType"]=="share"){
var data="shareId="+_4c8+"&shareUserId="+_4c9+"&post="+XN.json.build(post)+"&from=\"0101010901\"";
var url="http://share.renren.com/share/submit.do";
}else{
if(This.config["feedType"]&&This.config["feedType"]=="blog"){
var data="ownerId="+This.getConfig("ownerId")+"&blogId="+_4c8+"&isBlogShare=1&body="+encodeURIComponent(XN.string.ltrim(_4c6));
var url="http://blog.renren.com/share/createShareBlog";
}
}
new XN.NET.xmlhttp({url:url,data:data,onSuccess:function(r){
if(This.config["feedType"]&&This.config["feedType"]=="blog"){
var res=XN.json.parse(r.responseText);
if(res.code!=0){
var p=XN.DO.alert({message:"<div style=\"width:100%;text-align:center\">"+res.msg+"</div>",autoHide:3});
p.header.hide();
p.footer.hide();
}
}
},onError:function(){
}});
},disableSubmit:function(){
var el=this.getEl("submit");
el.addClass("gray");
el.disabled=true;
},enableSubmit:function(){
var el=this.getEl("submit");
el.delClass("gray");
el.disabled=false;
},_onReplyError:function(msg){
this.editMode();
this.getEl("input").blur();
this.getEl("input").focus();
XN.DO.showError(msg);
},_onReplySuccess:function(v){
var This=this;
if(XN.jebe&&XN.jebe.refreshAd){
try{
XN.jebe.refreshAd(5);
}
catch(e){
}
}
this.clearReply();
this._replyCount++;
this.updateReplyCounter();
this.resetInput();
this.simpleMode();
this.getEl("input").blur();
this.getEl("input").value=this.getTip("inputTip");
this.getEl("input").style.color="#888";
var div=$element("div");
div.className="statuscmtitem";
div.id="status_reply_"+v.id;
var html=[];
html.push("<span class=\"share-n-hide float-right\"><a class=\"x-to-hide\" href=\"javascript:;\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+this.getConfig("delFlag")+"').del('"+v.replyerId+"','"+v.id+"');\"> </a></span>");
html.push("<a class=\"minfriendpic\" namecard=\""+v.replyerId+"\" style=\"background-image: url("+v.replyerHead+")\" href=\"http://www."+XN.env.domain+"/profile.do?id="+v.replyerId+"\" target=\"_blank\"></a>");
html.push("<p class=\"replybody\">");
var _4d7=v.vipIconUrl?"<a href=\"http://i.renren.com/icon\"><img style=\"margin:0 3px 3px 3px;\" src=\""+v.vipIconUrl+"\" alt=\"vip\"/></a>":"";
html.push("<a class=\"replyername\" namecard=\""+v.replyerId+"\" href=\"http://www."+XN.env.domain+"/profile.do?id="+v.replyerId+"\" target=\"_blank\">"+v.replyerName+"</a>"+_4d7+": ");
html.push("<span class=\"replycontent\">"+v.replyContent+"</span>");
html.push("<br /><span class=\"time\" style=\"margin:0;color:#888;\">"+v.replyTime+"</span><br/>");
html.push("</p>");
div.innerHTML=html.join("");
this.getEl("replyList").show();
this.getEl("replyList").appendChild(div);
this.showMore("s");
},del:function(uid,sid){
var This=this;
function request(){
var p={};
p["replyId"]=sid;
p["source"]=This.getConfig("doingId");
p["doingId"]=This.getConfig("doingId");
p["owner"]=This.getConfig("ownerId");
p["t"]=This.getConfig("type");
p["feedId"]=This.getConfig("feedId");
p["createId"]=uid;
var ban=$("banReply");
if(ban){
p["ban"]=ban.checked?1:0;
}
new XN.NET.xmlhttp({url:This.getConfig("delReplyURI"),data:XN.ARRAY.toQueryString(p),onSuccess:function(){
This._onDeleteSuccess(sid);
},onError:function(){
XN.DO.showError(This.getTip("deleteError"));
}});
}
var _4dd=this.getTip("deleteConfirm");
if(XN.page&&XN.page.data&&(XN.page.data.type==1||XN.page.data.type==3)&&XN.page.data.isAdmin){
_4dd+="<label style=\"display:block;margin-top:5px;\"><input id=\"banReply\" type=\"checkbox\" value=\"1\"> \u540c\u65f6\u5c06\u8be5\u7528\u6237\u52a0\u5165\u9ed1\u540d\u5355</label>";
}
XN.DO.confirm({message:_4dd,callBack:function(r){
if(r){
request();
}
}});
},_onDeleteSuccess:function(id){
this._replyCount--;
this.updateReplyCounter();
$("status_reply_"+id).remove();
if(!this._showMore){
this.showMore();
}
},load:function(more){
var This=this;
if(more&&this.getEl("show_more_link")){
this.getEl("show_more_link").innerHTML="\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" />";
this.getEl("show_more_link").show();
}
var _4e2={};
_4e2["doingId"]=this.getConfig("ugcSource")||this.getConfig("doingId");
_4e2["source"]=this.getConfig("ugcSource")||this.getConfig("doingId");
_4e2["owner"]=this.getConfig("ownerId");
if(this.getConfig("type")){
_4e2["t"]=this.getConfig("type");
}
new XN.NET.xmlhttp({data:XN.array.toQueryString(_4e2),url:this.getConfig("loadReplyURI"),onComplete:function(){
if(more&&This.getEl("show_more_link")){
This.getEl("show_more_link").hide();
}
},onSuccess:function(r){
try{
var rt=XN.JSON.parse(r.responseText);
if(rt.code!==0){
XN.DO.showError(XN.APP.status.getError(rt.code)||rt.msg||This.getTip("loadError"));
return;
}
}
catch(e){
XN.DO.showError(This.getTip("loadError"));
return;
}
if(!This._replyCount){
This._replyCount=rt.replyList.length;
}
This._canDel=This.isHostId((rt.ownerId||rt.ownerid));
if(XN.user&&XN.user.auth&&parseInt(XN.user.auth,0)>=15){
XN.log("\u4f60\u6709\u6743\u9650\u5220\u9664\u522b\u4eba\u7684\u72b6\u6001,\u8fd9\u4e0b\u725bx\u4e86");
This._canDel=true;
}
if(more){
This._hasLoadAll=true;
This.renderReplys(rt.replyList,null,rt);
This.showMore();
}else{
This._updateUIonLoadReply(rt.replyList,null,null,null,null,null,rt);
}
},onError:function(){
XN.DO.showError(This.getTip("loadError"));
}});
},loadMore:function(){
this.load(true);
},loadJSON:function(json){
this.loadFromJSON=true;
this._replyCount=json.length;
this._canDel=this.isHostId(json.ownerid);
if(json.etype=="share_edm"){
this._canDel=false;
}
if(XN.user&&XN.user.isAdmin){
this._canDel=true;
}
this.config["ownerId"]=json.ownerid;
if(json.isOpenReply){
this._updateUIonLoadReply(json.replyList,parseInt(json.digged),parseInt(json.userDigged),json.type,json.ownerid,json.etype,json);
this.show("t");
}
},showMore:function(flag){
this._showMore=true;
if(!this.getEl("show_more_link")&&!this.getConfig("reply")){
return;
}
this.getEl("show_more_link")&&this.getEl("show_more_link").hide();
if(this.loadFromJSON&&!this._hasLoadAll){
this.loadMore();
}
this.getEl("replyList").delClass("nomore");
this.getEl("replyList").addClass("blockmore");
this.fireEvent("replyListOpened");
},insertCloseTag:function(){
if(this._showed){
return;
}
var _4e7=this.getEl("replyKey");
_4e7.innerHTML="\u6536\u8d77\u56de\u590d";
var _t=$element("span");
_t.className="seperator";
_t.innerHTML="|";
XN.dom.insertAfter(_t,_4e7);
this._showed=true;
},hideMore:function(){
this._showMore=false;
if(!this.getEl("show_more_link")){
return;
}
this.getEl("show_more_link").show();
this.getEl("replyList").addClass("nomore");
this.getEl("replyList").delClass("blockmore");
},_updateUIonLoadReply:function(obj,_4ea,_4eb,type,_4ed,_4ee,json){
var This=this;
var html=[],type=type||"";
html.push("<div class=\"min-cmtbox statustab\">");
html.push("<div class=\"mincmt-body\">");
var _4ee=_4ee||"normal";
var id=parseInt(this.getID("m").replace("m",""));
var _4f3=this.getConfig("ownerId");
XN.APP.status.fireEvent("ILikeInit",html,type,id,_4f3,_4ea,_4eb,_4ee);
html.push("<div class=\"statuscmtlist nomore\">");
html.push("<div style=\"display:none;\" id=\""+this.getID("replyList")+"\">");
html.push("</div>");
html.push("<div id=\""+this.getID("reply_editor")+"\" class=\"statuscmtitem reply-adding\">");
html.push("<div>");
if(!this.isProfile()){
html.push("<span id=\""+this.getID("user_head")+"\" style=\"display:none;background-image: url("+XN.user.tinyPic+");\" class=\"minfriendpic\"></span>");
}
html.push("<textarea id=\""+this.getID("input")+"\" stats=\"NF_Re\" class=\"input-text archive-inp\" type=\"text\" value=\"\" style=\"overflow-y:auto;height:16px;\" cols=\"30\" rows=\"1\"></textarea>");
html.push("</div>");
var _4f4="";
if(this.config["feedType"]&&this.emoListID[this.config["feedType"]]){
_4f4="<a href=\"#emotion\" onclick=\"return false;\" id=\""+this.getID("addEmoBtn")+"\" class=\"newsfeed-emo\">\u8868\u60c5</a>";
}
var _4f5="";
if(this.config["feedType"]&&(this.config["feedType"]=="status")){
_4f5=["<span class=\"fwdthisc\" id=\""+this.getID("fwdthisc")+"\" >","<input id=\""+this.getID("fwdthis")+"\" type=\"checkbox\" />","<label for=\""+this.getID("fwdthis")+"\">\u540c\u65f6\u5206\u4eab</label>","</span>"].join("");
}
if(this.config["feedType"]&&((this.config["feedType"]=="share")&&json.etype!="share_edm"||this.config["feedType"]=="blog")){
This.enableShare=true;
}
var _4f6="";
if(This.enableShare==true){
_4f6=["<span class=\"fwdthisc\" id=\""+this.getID("shareThis")+"\" >","<input id=\""+this.getID("share")+"\" type=\"checkbox\" />","<label for=\""+this.getID("share")+"\">\u540c\u65f6\u5206\u4eab</label>","</span>"].join("");
}
var _4f7="";
if(this.mentionWhiteList.indexOf(this.getConfig("feedType"))!=-1||this.getConfig("type")=="page"){
_4f7="<a href=\"#nogo\" onclick=\"return false;\" id=\""+this.getID("mentionBtn")+"\" class=\"mention-btn\">\u70b9\u540d</a>";
}
html.push(["<div class=\"reply-nav clearfix\" style=\"display:none;\" id=\""+this.getID("buttons")+"\">","<span class=\"replyAll clearfix\">","<input style=\"display:none;\" class=\"input-button\" id=\""+this.getID("submit")+"\" type=\"submit\" value=\"\u56de\u590d\" />","<span style=\"display:none;\" id=\""+this.getID("word_counter")+"\" class=\"mincmtcount\">0/70</span>",_4f7,_4f4,_4f5,_4f6,"</span>","</div>"].join(""));
html.push("</div>");
html.push("</div>");
html.push("</div>");
html.push("</div>");
try{
this.getEl("feedbody").innerHTML=html.join("");
}
catch(e){
XN.log(e);
}
this.renderReplys(obj,true,json);
this.attachEvent(type);
if(this.getConfig("showMore")&&!this.loadFromJSON){
this.showMore();
}else{
this.hideMore();
}
this.show(this.getConfig("showMore")?"advance":"simple");
},renderReplys:function(obj,init,json){
try{
var This=this;
var _4fc=obj.length;
var _4fd=This.getConfig("type")=="page";
var html=[];
var _4ff=[];
function addSpeClass(i){
if(i>0&&i<_4fc-1){
return "more";
}
return "";
}
if(_4fc==0&&this.getConfig("reply")){
var _501="\u663e\u793a\u5168\u90e8";
if(This._replyCount>=100){
if(This.getConfig("type")=="page"){
_501="\u663e\u793a"+This._replyCount+"\u6761\u4e2d\u7684\u6700\u65b0";
}else{
_501="\u663e\u793a\u6700\u65b0";
}
}
var tiao=(json.order=="up")?"\u56de\u590d":"<span id=\""+This.getID("counter_m")+"\">"+Math.min(This._replyCount,100)+"</span>\u6761\u56de\u590d";
_4ff.push("<div id=\""+This.getID("show_more_link")+"\" class=\"statuscmtitem showmorereply\">");
_4ff.push("<a href=\"javascript:;\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').showMore();\">"+_501+tiao+"</a>");
_4ff.push("</div>");
html.push(_4ff.join(""));
_4ff=[];
this.getEl("replyList").show();
}
XN.array.each(obj,function(i,v){
if(i==0&&This._replyCount>2){
var _505="\u8fd8\u6709";
if(json.order=="up"){
_505="\u663e\u793a\u5168\u90e8";
}
if(This._replyCount>=100){
if(This.getConfig("type")=="page"){
_505="\u663e\u793a"+This._replyCount+"\u6761\u4e2d\u7684\u6700\u65b0";
}else{
_505="\u663e\u793a\u6700\u65b0";
}
}
var tiao=(json.order=="up")?"\u56de\u590d":"<span id=\""+This.getID("counter_m")+"\">"+Math.min(This._replyCount-2,100)+"</span>\u6761\u56de\u590d";
if(This.getConfig("feedType")=="share_edm"&&This.replyCount<100){
tiao="";
}
_4ff.push("<div id=\""+This.getID("show_more_link")+"\" class=\"statuscmtitem showmorereply\" style=\"text-indent:37px;\">");
_4ff.push("<a href=\"javascript:;\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').showMore();\">"+_505+tiao+"</a>");
_4ff.push("</div>");
if(json.order=="up"){
html.push(_4ff.join(""));
_4ff=[];
}
}
var _507="http://admin.renren.com/admin/newuserreport.do?type=31&owner="+This.getConfig("ownerId")+"&contentId="+v.id+"&userId="+v.ubid+"&pid="+This.getConfig("doingId")+"&origURL="+location.href;
var _508="<span class=\"reply-report\"><a href=\""+_507+"\">\u4e3e\u62a5</a></span>";
if(!_4fd){
_508="";
}
_508="";
html.push("<div id=\"status_reply_"+v.id+"\" class=\"statuscmtitem "+addSpeClass(i)+"\">");
if(json.canDel||This.isHostId(v.ubid)||This.canDel()){
html.push("<span class=\"share-n-hide float-right\"><a class=\"x-to-hide\" href=\"javascript:;\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').del('"+v.ubid+"','"+v.id+"');\"> </a></span>");
}
if(init&&XN.string.startsWith(window.location.href+"","http://home")){
html.push("<a style=\"float:left;\" target=\"_blank\" href=\"http://www."+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\"><img needclip=\"1\" width=\"30\" height=\"30\" src=\"http://s.xnimg.cn/a.gif\" onload=\"feed_img_delay_load(this, 's');\" lala=\""+v.replyer_tinyurl+"\" /></a>");
}else{
html.push("<a class=\"minfriendpic\" namecard=\""+v.ubid+"\" target=\"_blank\" style=\"background-image: url("+v.replyer_tinyurl+")\" href=\"http://www."+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\"></a>");
}
html.push("<p class=\"replybody\">");
var _509=v.vip_icon_url||v.vipIconUrl;
var _50a=(_509)?"<a href=\"http://i.renren.com/icon\"><img style=\"margin:0 3px 3px 3px;\" src=\""+_509+"\" alt=\"vip\"/></a>":"";
html.push("<a class=\"replyername\" namecard=\""+v.ubid+"\" target=\"_blank\" href=\"http://www."+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\">"+v.ubname+"</a>"+_50a+_508+": ");
var _50b="<a href=\"javascript:;\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').replyTo( '"+v.id+"','"+v.ubid+"','"+ecd(v.ubname)+"');\">\u56de\u590d</a>";
html.push("<span class=\"replycontent\">"+v.replyContent+"</span>");
var _50c=This.isHostId(v.ubid);
var _50d=This.getConfig("type")=="page";
var _50e=This.getConfig("type")=="love";
var _50f=XN.page&&XN.page.data&&XN.page.data.isAdmin;
var _510=This.getConfig("feedType")=="edm";
if((!_50c&&!_510&&!_50d)||_50e){
html.push(_50b);
}
html.push("<br /><span style=\"margin:0;color:#888;\" class=\"time\">"+v.replyTime+"</span>");
html.push("</p>");
html.push("</div>");
if(i==0&&This._replyCount>2){
html.push(_4ff.join(""));
}
});
if(obj.length){
this.getEl("replyList").show();
}
try{
this.getEl("replyList").innerHTML=html.join("");
}
catch(e){
}
if(XN.browser.IE&&document.body.id=="profile"){
XN.ui.refreshAll();
}
}
catch(e){
}
},attachEvent:function(){
var This=this;
try{
This.getEl("input").addEvent("focus",function(){
if(!This.getEl("input").value||This.getEl("input").value==This.getTip("inputTip")){
This.resetInput();
}
This.editMode();
},false);
this.getEl("input").addEvent("blur",function(){
if(XN.page&&XN.page.data&&XN.page.data.isAdmin&&XN.user&&XN.user.name&&This.getEl("input").value==("\u3010"+XN.user.name+"\u3011\uff1a")){
This.getEl("input").value=This.getTip("inputTip");
This.getEl("input").style.color="#888888";
}
var v=This.getEl("input").value;
if(v!==""&&v!=This.getTip("inputTip")){
if(ns._emoFlyer){
This.hideEmoFlyer();
}
}else{
This.simpleMode();
}
});
this.getEl("submit").addEvent("click",function(){
var v=This.getEl("input").value;
if(v===""||v==This.getTip("inputTip")){
return;
}
This.sendReply();
});
this._inputHelper=new XN.form.help(this.getEl("input")).onEsc(function(){
This.hide();
if(ns._emoFlyer){
This.hideEmoFlyer();
}
}).countSize(this.getID("word_counter"),this.getConfig("maxlength")).setDefaultValue(this.getTip("inputTip"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
var _515=This.getEl("input");
if(_515.mention&&_515.mention.selectorShow&&!_515.mention.noMatch){
return;
}
This.sendReply();
}
});
if(this.mentionWhiteList.indexOf(this.getConfig("feedType"))!=-1||this.getConfig("type")=="page"){
object.use("xn.mention",function(_516,xn){
xn.mention.Mention.init([{obj:This.getEl("input"),ugcId:This.getConfig("doingId"),ugcType:This.getConfig("feedType"),ownerId:This.getConfig("ownerid")}]);
});
}
XN.event.addEvent(this.getEl("input"),"keyup",function(e){
This.saveInputPos();
});
XN.event.addEvent(this.getEl("input"),"mouseup",function(e){
This.saveInputPos();
});
XN.event.addEvent(this.getEl("input"),"focus",function(e){
window.setTimeout(function(){
This.saveInputPos();
},0);
});
if(this.getEl("fwdthis")){
XN.event.addEvent(this.getEl("fwdthis"),"click",function(e){
This._inputHelper.focus();
if(This.getEl("fwdthis").checked){
This.fwdThis=true;
}else{
This.fwdThis=false;
}
});
}
if(this.getEl("share")){
XN.event.addEvent(this.getEl("share"),"click",function(e){
This._inputHelper.focus();
if(This.getEl("share").checked){
This.shareThis=true;
}else{
This.shareThis=false;
}
});
}
if(this.config["feedType"]&&this.emoListID[this.config["feedType"]]){
var This=this,_51d=This.config["feedType"];
XN.event.addEvent(this.getEl("addEmoBtn"),"click",function(e){
if(_51d=="status"||_51d=="checkin"||_51d=="app"){
This._inputHelper.focus();
if(This.config["feedType"]=="app"){
if(!XN.app.status.emoJsonForNewsFeedCommon){
This.getNewsFeedEmoJsonCommon(function(){
This.showEmoFlyer();
});
}else{
This.showEmoFlyer();
}
}else{
if(!XN.app.status.emoJsonForNewsFeedStatus){
This.getNewsFeedEmoJsonStatus(function(){
This.showEmoFlyer();
});
}else{
This.showEmoFlyer();
}
}
}else{
var pos=This._inputHelper.cursorPos;
This._inputHelper.focus(pos.start);
if(!This._emotions){
XN.loadFiles(["http://s.xnimg.cn/jspro/xn.ui.emoticons.js","http://s.xnimg.cn/csspro/module/minieditor.css"],function(){
This._emotions=XN.ui.emoticons({input:This.getEl("input"),onShowEmoPop:function(){
This._inputHelper.focus(this.pos.start);
},onEmoTabSwitch:function(){
This._inputHelper.focus(this.pos.start);
},onEmoNotVip:function(){
This._inputHelper.focus(this.pos.start);
},onEmoTabClick:function(){
This._inputHelper.focus(this.pos.start);
}});
$extend(This._emotions.pos,{start:pos.start,end:pos.end});
This._emotions.showEmoPop(e||window.event);
});
}else{
$extend(This._emotions.pos,{start:pos.start,end:pos.end});
This._emotions.showEmoPop(e||window.event);
}
}
});
}
}
catch(e){
}
if(this.getEl("mentionBtn")){
var This=this;
var _520=this._inputHelper.element;
this.getEl("mentionBtn").addEvent("click",function(e){
This._inputHelper.focus();
var ov=XN.form.help(_520).getRealValue();
var cp=This._inputHelper.cursorPos.start;
var bov=ov.substring(0,cp),aov=ov.substring(cp);
if(bov.substring(bov.length-1)!="@"){
_520.value=(bov+"@"+aov).slice(0,240);
cp++;
}
XN.form.help(_520).focus(cp);
_520.mention.check();
This.saveInputPos();
});
if(_520.mention){
_520.mention.addEvent("refocus",function(){
This.saveInputPos();
});
}
}
},emoListID:{"status":1,"blog":100,"photo":100,"album":100,"share":100,"video":100,"tv":100,"app":2,"checkin":1,"mini-status":1,"mini-blog":100,"mini-photo":100,"mini-album":100,"mini-share":100},mentionWhiteList:["blog","share","photo","album","status","gift","music","video","checkin","app","tv"],getNewsFeedEmoJsonCommon:function(fn){
var This=this;
var url="http://status."+XN.env.domain+"/getubblist.do?type=9";
new XN.net.xmlhttp({url:url,method:"GET",onSuccess:function(r){
XN.app.status.emoJsonForNewsFeedCommon=r.responseText;
if(fn){
fn.call(This);
}
},onError:XN.func.empty});
},getNewsFeedEmoJsonStatus:function(fn){
var This=this;
var url="http://status."+XN.env.domain+"/getdoingubblist.do";
new XN.net.xmlhttp({url:url,method:"GET",onSuccess:function(r){
XN.app.status.emoJsonForNewsFeedStatus=r.responseText;
if(fn){
fn.call(This);
}
},onError:XN.func.empty});
},getEmoList:function(){
var _52e="",type=this.config["feedType"];
if(this.emoListID[type]==1){
if($("status_emotions")){
_52e="<ul class=\"emotion\">";
_52e+=$("status_emotions").innerHTML;
_52e+="</ul>";
}else{
if($("home")){
XN.widgets.publisher.statusEditor.loadRealEmotion();
_52e=$("publisher_emotion").innerHTML;
}else{
if(!XN.app.status.emoJsonForNewsFeedStatus){
return false;
}
var _emo=XN.json.parse(XN.app.status.emoJsonForNewsFeedStatus).ubbList;
_52e="<ul class=\"emotion\">";
for(var i=0;i<_emo.length;i++){
_52e+="<li><a href=\"javascript:;\"><img src=\"http://a.xnimg.cn"+_emo[i].src+"\" title=\""+_emo[i].alt+"\" title=\""+_emo[i].alt+"\" emotion=\""+_emo[i].ubb+"\"></a>";
}
_52e+="</ul>";
}
}
}else{
if(this.emoListID[type]==2){
if(!XN.app.status.emoJsonForNewsFeedCommon){
return false;
}
var _emo=XN.json.parse(XN.app.status.emoJsonForNewsFeedCommon).ubbList;
_52e="<ul class=\"emotion\">";
for(var i=0;i<_emo.length;i++){
if(_emo[i].types==0){
continue;
}
_52e+="<li><a href=\"javascript:;\"><img src=\"http://a.xnimg.cn"+_emo[i].src+"\" title=\""+_emo[i].alt+"\" title=\""+_emo[i].alt+"\" emotion=\""+_emo[i].ubb+"\"></a>";
}
_52e+="</ul>";
}
}
return {"id":this.emoListID[type],"list":_52e};
},showEmoFlyer:function(){
var _532=this.getEl("input"),This=this,type=this.config["feedType"];
this._inputHelper.focus();
if(!ns._emoFlyer){
ns._emoFlyer={};
}
var _535=this.getEmoList(type);
if(!_535){
XN.Do.showError("\u83b7\u53d6\u8868\u60c5\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5","\u51fa\u9519\u4e86",3);
return;
}
if(!ns._emoFlyer[_535.id]){
ns._emoFlyer[_535.id]=new XN.ui.fixPositionElement({tagName:"div",alignType:"3-2",offsetY:-1});
ns._emoFlyer[_535.id].setContent(_535.list);
ns._emoFlyer[_535.id].container.className="newsfeed-reply-emotions";
XN.event.addEvent(ns._emoFlyer[_535.id].container,"click",function(e){
XN.event.stop(e||window.event);
});
}
ns._emoFlyer[_535.id].alignWith=_532;
ns._emoFlyer[_535.id].refresh();
ns._emoFlyer[_535.id].show();
this.clearEmoParseHook();
ns._parseEmoTmpFunc=function(e){
This._parseEmotion(e,This);
};
XN.event.addEvent(ns._emoFlyer[_535.id].container,"mousedown",ns._parseEmoTmpFunc);
},hideEmoFlyer:function(){
for(p in ns._emoFlyer){
try{
ns._emoFlyer[p].hide();
}
catch(e){
}
}
},clearEmoParseHook:function(){
if(!ns._emoFlyer||!ns._parseEmoTmpFunc){
return;
}
for(p in ns._emoFlyer){
try{
XN.event.delEvent(ns._emoFlyer[p].container,"mousedown",ns._parseEmoTmpFunc);
}
catch(e){
}
}
},_parseEmotion:function(e,This){
XN.event.stop(e||window.event);
var img=XN.event.element(e);
if(img.tagName.toLowerCase()=="li"||img.tagName.toLowerCase()=="a"){
img=img.getElementsByTagName("img")[0];
}
if(img&&img.tagName.toLowerCase()=="img"){
var pos=This._inputHelper.cursorPos,_53c=This.getEl("input"),code=img.getAttribute("emotion");
_53c.value=_53c.value.slice(0,pos.start)+code+_53c.value.slice(pos.end);
This.getEl("input").blur();
if(XN.browser.IE){
setTimeout(function(){
This._inputHelper.focus(pos.start+code.length);
This.saveInputPos();
},0);
}else{
This._inputHelper.focus(pos.start+code.length);
This.saveInputPos();
}
}
},_resetInput:function(){
this.getEl("input").disabled=false;
if(XN.page&&XN.page.data&&XN.page.data.type==5&&XN.page.data.isAdmin&&XN.user&&XN.user.name){
var _53e=this.getEl("input");
_53e.value="\u3010"+XN.user.name+"\u3011\uff1a";
if(XN.browser.IE){
var r=_53e.createTextRange();
r.collapse(false);
r.select();
}
}else{
if(this.getConfig("reply")){
this.getEl("input").value="\u56de\u590d"+this.getConfig("fName")+"\uff1a ";
this.replyTo(this.getConfig("doingId"),this.getConfig("fId"),this.getConfig("fName"));
}else{
this.getEl("input").value="";
}
}
this.resetInputCounter();
},resetInput:function(){
this._resetInput();
this._inputHelper.focus();
this.saveInputPos();
},saveInputPos:function(){
this._inputHelper.cursorPos=this._inputHelper.cursorPosition();
},resetInputCounter:function(){
var _540=this.getEl("word_counter");
_540.innerHTML=this.getEl("input").value.length+"/"+this.getConfig("maxlength");
_540.delClass("full");
},_modeTimer:null,_firstFocus:true,editMode:function(){
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
if(!this.isProfile()){
this.getEl("reply_editor").addClass("actived");
this.getEl("user_head").show();
}
this.getEl("input").disabled=false;
this.getEl("input").style.color="#333";
this.getEl("input").style.height="32px";
this.getEl("input").style.border="1px solid #5D74A2";
this.enableSubmit();
this.getEl("submit").value="\u56de\u590d";
this.getEl("submit").show();
this.getEl("word_counter").show();
if(this._replyCount&&!this.isProfile()&&XN.config.status.enableReplyAll){
}
this.resetInputCounter();
this.getEl("buttons").show();
},simpleMode:function(){
var This=this;
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
this._modeTimer=setTimeout(function(){
if(!This.getEl("input")){
return;
}
This.getEl("buttons").hide();
if(!This.isProfile()){
This.getEl("reply_editor").delClass("actived");
This.getEl("user_head").hide();
}
This.getEl("input").disabled=false;
This.getEl("input").style.height="16px";
This.getEl("submit").hide();
This.getEl("word_counter").hide();
This.getEl("input").style.border="1px solid #BDC7D8";
if(XN.config.status.enableReplyAll){
}
},200);
if(ns._emoFlyer){
this.hideEmoFlyer();
}
},preventDbclick:function(){
this.disableSubmit();
this.getEl("submit").value=this.getTip("sending");
this.getEl("input").disabled=true;
},changeMode:function(){
if(this.view=="reply"){
this.hide();
}else{
this.show();
}
},show:function(mode){
try{
mode=mode||"advance";
this.view="reply";
this._replyData=null;
this.getEl("feedbody").show();
if(this.getEl("replyKey")){
this.getEl("replyKey").innerHTML="\u6536\u8d77\u56de\u590d";
}
if(mode=="advance"){
this.getEl("input").focus();
this.getEl("input").style.color="#333";
this.showMore();
this.saveInputPos();
}
}
catch(e){
}
},hide:function(){
var _543;
if(this._replyCount==0){
_543="";
}else{
if(this._replyCount>=100&&this.getConfig("type")!=="page"){
_543="100+";
}else{
_543=this._replyCount;
}
}
if(_543){
_543="("+_543+")";
}else{
_543="";
}
this.view="close";
this._resetInput();
this.getEl("feedbody").hide();
this.getEl("replyKey").innerHTML="<span id=\""+this.getID("replyCount")+"\"></span>\u56de\u590d"+_543;
this.clearReply();
}};
XN.EVENT.enableCustomEvent(ns.replyEditor.prototype);
})(XN.APP.status);
getReplyOfDoingFromJSON=function(json,_545,_546,_547,type,_549,_54a,_54b,_54c,_54d){
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
json.length=parseInt(_547,0);
if(isNaN(json.length)){
json.length=0;
}
var _550=json.type||"";
var _551={ownerid:json.ownerid,doingId:_545,hostId:_546,delFlag:_54a||"f",type:type,showMore:false,fromId:_549,shareId:_54d,feedType:_550,feedId:_54c,ugcSource:json.source,reply:json.reply,fId:json.fId,fName:json.fName};
var fin=json.fin||"";
var _553=json.type||"";
if(XN.app.status.crossDomain){
$extend(_551,{loadReplyURI:"http://status."+XN.env.domain+"/feedcommentretrieve.do",sendReplyURI:"http://status."+XN.env.domain+"/feedcommentreply.do?fin="+fin+"&ft="+_553+"&ff_id="+json.ownerid,delReplyURI:"http://status."+XN.env.domain+"/feedcommentdelete.do"});
}
json.isOpenReply=_54b===false?false:true;
new XN.app.status.replyEditor(_551).loadJSON(json);
});
};
getReplyOfTheDoing=function(_554,_555,_556,_557,auto,type,_55a,_55b,_55c){
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
try{
XN.app.status.notify.del(_554);
}
catch(e){
}
var ed=getReplyEditor(_554,_557);
if(ed){
try{
var ce=ed.getEl("input").value;
ed.changeMode();
return;
}
catch(e){
}
}
var _561=!(auto||false);
if(!_55b){
_55b="";
}
if($("pageStatus")){
_55b="status";
}
XN.log("feedtype:"+_55b);
var _562={doingId:_554,shareId:_55c,hostId:_556,delFlag:_557,showMore:_561,ownerId:_555,type:type,fromId:_55a,feedType:_55b};
if(XN.app.status.crossDomain){
$extend(_562,{loadReplyURI:"http://status."+XN.env.domain+"/feedcommentretrieve.do",sendReplyURI:"http://status."+XN.env.domain+"/feedcommentreply.do",delReplyURI:"http://status."+XN.env.domain+"/feedcommentdelete.do"});
}
new XN.app.status.replyEditor(_562).load();
});
};
getReplyOfDoingFromJSON4Page=function(json,_564,_565,_566,_567,_568,_569){
json.length=parseInt(_566,0);
if(isNaN(json.length)){
json.length=0;
}
var _56a={doingId:_564,hostId:_565,delFlag:"f",type:"page",showMore:false};
if((XN.page&&XN.page.data&&XN.page.data.type==5)||_568){
_56a.type="love";
}
if(_568){
$extend(_56a,{loadReplyURI:"http://lover."+XN.env.domain+"/doing/replyList",sendReplyURI:"http://lover."+XN.env.domain+"/doing/reply",delReplyURI:"http://lover."+XN.env.domain+"/doing/delReply"});
}else{
$extend(_56a,{loadReplyURI:"http://"+getWWWRoot(_569)+"/doing/replyList",sendReplyURI:"http://"+getWWWRoot(_569)+"/doing/reply",delReplyURI:"http://"+getWWWRoot(_569)+"/doing/delReply"});
}
json.isOpenReply=_567===false?false:true;
new XN.app.status.replyEditor(_56a).loadJSON(json);
};
getReplyOfDoingFromJSON4Page2=function(json,_56c,_56d,_56e,_56f,type){
var _571=function(type){
switch(type){
case "blog":
return {loadReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/note/replyList",sendReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/note/reply",delReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/note/replyDelete"};
case "album":
return {loadReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/album/replyList",sendReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/album/reply",delReplyURI:"http://page."+XN.env.domain+"/"+json.ownerid+"/album/replyDelete"};
}
};
json.length=parseInt(_56e,0);
if(isNaN(json.length)){
json.length=0;
}
var _573={doingId:_56c,hostId:_56d,delFlag:"f",type:"page",commentType:type,feedType:"page",showMore:false};
$extend(_573,_571(type));
json.isOpenReply=_56f===false?false:true;
new XN.app.status.replyEditor(_573).loadJSON(json);
};
getReplyOfTheDoing4Page=function(_574,_575,_576,_577,auto,_579){
var ed=getReplyEditor(_574,_577);
if(ed){
try{
ed.changeMode();
return;
}
catch(e){
}
}
var _57b=!(auto||false);
var _57c={doingId:_574,hostId:_576,delFlag:_577,showMore:_57b,type:"page",ownerId:_575};
$extend(_57c,{loadReplyURI:"http://"+getWWWRoot(_579)+"/doing/replyList",sendReplyURI:"http://"+getWWWRoot(_579)+"/doing/reply",delReplyURI:"http://"+getWWWRoot(_579)+"/doing/delReply"});
new XN.app.status.replyEditor(_57c).load();
};
XN.app.status.replyEditor4Qun=function(_57d){
XN.app.status.replyEditor.call(this,_57d);
};
$extend(XN.app.status.replyEditor4Qun.prototype,XN.app.status.replyEditor.prototype);
$extend(XN.app.status.replyEditor4Qun.prototype,{load:function(more){
var This=this;
if(more&&this.getEl("show_more_link")){
this.getEl("show_more_link").innerHTML="\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" />";
this.getEl("show_more_link").show();
}
var _580={};
_580["doingId"]=this.getConfig("doingId");
_580["source"]=this.getConfig("doingId");
_580["owner"]=this.getConfig("ownerId");
if(this.getConfig("type")){
_580["t"]=this.getConfig("type");
}
new XN.NET.xmlhttp({data:XN.array.toQueryString(_580),url:this.getConfig("loadReplyURI"),method:"GET",onComplete:function(){
if(more&&This.getEl("show_more_link")){
This.getEl("show_more_link").hide();
}
},onSuccess:function(r){
try{
var _rt=XN.JSON.parse(r.responseText);
if(_rt.code!==0){
XN.DO.showError(_rt.msg||This.getTip("loadError"));
return;
}
}
catch(e){
XN.DO.showError(This.getTip("loadError"));
return;
}
var rt=This.reformatListData(_rt);
if(!This._replyCount){
This._replyCount=rt.replyList.length;
}
if((XN.user&&XN.user.auth&&parseInt(XN.user.auth,0)>=15)||(XN.app.miniGroup&&XN.app.miniGroup.pageData&&XN.app.miniGroup.pageData.isAdmin)){
XN.log("\u4f60\u6709\u6743\u9650\u5220\u9664\u522b\u4eba\u7684\u72b6\u6001,\u8fd9\u4e0b\u725bx\u4e86");
This._canDel=true;
}
if(more){
This._hasLoadAll=true;
This.renderReplys(rt.replyList,null,rt);
This.showMore();
}else{
This._updateUIonLoadReply(rt.replyList,null,null,null,null,null,rt);
}
},onError:function(){
XN.DO.showError(This.getTip("loadError"));
}});
},ajaxSendAction:function(_584){
var This=this,data={};
this.preventDbclick();
$extend(data,{content:_584.c,ubbType:1,toid:_584.replyTo||0});
this._replyRequest=new XN.NET.xmlhttp({url:this.getConfig("sendReplyURI"),data:XN.array.toQueryString(data),onSuccess:function(r){
var str=r.responseText;
if(!str||str=="empty"){
return;
}
var rt=XN.JSON.parse(str);
if(rt.code==0){
This._onReplySuccess(This.formatSingleData(rt));
}else{
This._onReplyError(rt.msg);
}
},onError:function(){
This._onReplyError(This.getTip("replyError"));
}});
},del:function(uid,sid){
var This=this;
function request(){
new XN.NET.xmlhttp({url:This.getConfig("delReplyURI").replace("{commentId}",sid),onSuccess:function(){
This._onDeleteSuccess(sid);
},onError:function(){
XN.DO.showError(This.getTip("deleteError"));
}});
}
var _58d=this.getTip("deleteConfirm");
XN.DO.confirm({message:_58d,callback:function(r){
if(r){
request();
}
}});
},reformatListData:function(rt){
var tRt={replyList:[]},_591=rt.comments,This=this;
XN.array.each(_591,function(i,v){
tRt.replyList.push(This.formatSingleData(v));
});
return tRt;
},formatSingleData:function(v){
return {"id":v.id,"replyer_tinyurl":v.headUrl,"replyerHead":v.headUrl,"replyContent":v.body,"type":0,"replyTime":v.time,"ubname":v.name,"replyerName":v.name,"reply_layer":0,"ubid":v.author};
}});
getReplyOfDoingFromJSON4Qun=function(json,_597,_598,_599,type,_59b,_59c,_59d,_59e){
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
json.length=parseInt(_599,0);
if(isNaN(json.length)){
json.length=0;
}
var _5a1=json.type||"",_5a2={ownerid:json.ownerid,doingId:_597,hostId:_598,delFlag:_59c||"f",type:type,showMore:false,fromId:_59b,shareId:undefined,feedType:_5a1,feedId:""},fin=json.fin||"",_5a4=json.type||"",_5a5=_5a4.replace("mini-",""),mid=_59e;
$extend(json,{canDel:!!(XN.app.miniGroup&&XN.app.miniGroup.pageData.isAdmin)});
var _5a7="?count=100&ubbType=1&isDesc=true&commentId=0";
if(XN.app.status.crossDomain){
$extend(_5a2,{loadReplyURI:"http://qun."+XN.env.domain+"/qun/ugc/"+mid+"/comment/"+_5a5+"/"+_597+_5a7,sendReplyURI:"http://qun."+XN.env.domain+"/qun/ugc/"+mid+"/comment/"+_5a5+"/"+_597,delReplyURI:"http://qun."+XN.env.domain+"/qun/ugc/"+mid+"/comment/"+_5a5+"/"+_597+"/{commentId}/delete?ubbType=1"});
}
json.isOpenReply=_59d===false?false:true;
new XN.app.status.replyEditor4Qun(_5a2).loadJSON(json);
});
};
XN.app.status.replyEditor4Zhan=function(_5a8){
XN.app.status.replyEditor.call(this,_5a8);
};
$extend(XN.app.status.replyEditor4Zhan.prototype,XN.app.status.replyEditor.prototype);
$extend(XN.app.status.replyEditor4Zhan.prototype,{load:function(more){
var This=this;
if(more&&this.getEl("show_more_link")){
this.getEl("show_more_link").innerHTML="\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" />";
this.getEl("show_more_link").show();
}
var _5ab={};
_5ab["doingId"]=this.getConfig("doingId");
_5ab["source"]=this.getConfig("doingId");
_5ab["owner"]=this.getConfig("ownerId");
if(this.getConfig("type")){
_5ab["t"]=this.getConfig("type");
}
new XN.NET.xmlhttp({data:XN.array.toQueryString(_5ab),url:this.getConfig("loadReplyURI"),method:"GET",onComplete:function(){
if(more&&This.getEl("show_more_link")){
This.getEl("show_more_link").hide();
}
},onSuccess:function(r){
var data=null;
try{
data=XN.JSON.parse(r.responseText);
if(data.code!==0){
XN.DO.showError(data.msg||This.getTip("loadError"));
return;
}
}
catch(e){
XN.DO.showError(This.getTip("loadError"));
return;
}
var rt=This.formatListData(data);
if(!This._replyCount){
This._replyCount=rt.replyList.length;
}
if(XN.user&&XN.user.auth&&parseInt(XN.user.auth,0)>=15){
This._canDel=true;
}
if(more){
This._hasLoadAll=true;
This.renderReplys(rt.replyList,null,rt);
This.showMore();
}else{
This._updateUIonLoadReply(rt.replyList,null,null,null,null,null,rt);
}
},onError:function(){
XN.DO.showError(This.getTip("loadError"));
}});
},ajaxSendAction:function(_5af){
var This=this;
this.preventDbclick();
var data=$extend({},{content:_5af.c,type:"nf",toId:_5af.replyTo||0});
this._replyRequest=new XN.NET.xmlhttp({url:this.getConfig("sendReplyURI"),data:XN.array.toQueryString(data),onSuccess:function(r){
var str=r.responseText;
if(!str||str=="empty"){
return;
}
var rt=XN.JSON.parse(str);
if(rt.code==0){
This._onReplySuccess(This.formatSingleData(rt));
}else{
This._onReplyError(rt.msg);
}
},onError:function(){
This._onReplyError(This.getTip("replyError"));
}});
},del:function(uid,sid){
var This=this;
function request(){
new XN.NET.xmlhttp({url:This.getConfig("delReplyURI").replace("{commentId}",sid),onSuccess:function(){
This._onDeleteSuccess(sid);
},onError:function(){
XN.DO.showError(This.getTip("deleteError"));
}});
}
var _5b8=this.getTip("deleteConfirm");
XN.DO.confirm({message:_5b8,callback:function(r){
if(r){
request();
}
}});
},formatListData:function(data){
var _5bb={replyList:[]};
var that=this;
XN.array.each(data.replyList,function(i,v){
_5bb.replyList.push(that.formatSingleData(v));
});
return _5bb;
},formatSingleData:function(v){
return {"id":v.id,"replyer_tinyurl":v.replyerHead,"replyerHead":v.replyerHead,"replyContent":v.replyContent,"replyTime":v.replyTime,"ubid":v.replyerId,"ubname":v.replyerName,"replyerId":v.replyerId,"replyerName":v.replyerName,"type":0,"reply_layer":0};
}});
getReplyOfDoingFromJSON4Zhan=function(json,_5c1,_5c2,_5c3,type,_5c5,_5c6,_5c7,_5c8){
_5c8=_5c8||123;
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
json.length=parseInt(_5c3,0);
if(isNaN(json.length)){
json.length=0;
}
var _5cb=json.type||"",_5cc={ownerid:json.ownerid,doingId:_5c1,hostId:_5c2,delFlag:_5c6||"f",type:type,showMore:false,fromId:_5c5,shareId:undefined,feedType:_5cb,feedId:""};
$extend(_5cc,{loadReplyURI:"http://zhan."+XN.env.domain+"/"+_5c8+"/"+_5c1+"/comment/list/top?count=100",sendReplyURI:"http://zhan."+XN.env.domain+"/"+_5c8+"/"+_5c1+"/comment",delReplyURI:"http://zhan."+XN.env.domain+"/"+_5c8+"/"+_5c1+"/comment/{commentId}/delete"});
json.isOpenReply=_5c7;
new XN.app.status.replyEditor4Zhan(_5cc).loadJSON(json);
});
};
function replyDelete(ele){
var url,p={},tip;
var ars=arguments;
if(ars[2]){
url="http://status."+XN.env.domain+"/doing/deleteReply.do";
p["replyId"]=ars[2];
p["doingId"]=ars[1];
tip="\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u56de\u590d\u5417?";
}else{
url="http://status."+XN.env.domain+"/doing/deleteDoing.do";
p["id"]=ars[1];
if(ars[3]){
p["ownerid"]=ars[3];
}
tip="\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u72b6\u6001\u5417?";
}
function onSuccess(){
XN.Element.hide($(ele),"fade");
}
function del(){
new XN.NET.xmlhttp({url:url,data:XN.ARRAY.toQueryString(p),onComplete:onSuccess});
}
XN.DO.confirm({message:tip,callBack:function(r){
if(r){
del();
}
}});
}
function delMyDoing(obj,_5d4){
replyDelete(obj,_5d4);
}
function sudoDelDoing(obj,_5d6,_5d7){
replyDelete(obj,_5d6,null,_5d7);
}
delMyRpDoing=function(el,_5d9,rid){
replyDelete(el,_5d9,rid);
};
(function(ns){
ns.miniFeed=function(_5dc){
if(!_5dc){
_5dc={};
}
if(!_5dc.IDframe){
_5dc={IDtools:"mini_tools",IDmeta:"mini_meta",IDform:"mini_upload_form",IDsubmit:"mini_submit",IDinput:"mini_statusInput",IDinputContent:"mini_statusInput",IDcurrentStatus:"mini_currentFeed",IDupdateTime:"mini_statusUpdateTime",IDspecial:"mini_commendStatus",IDemotion:"mini_emotion",IDcommentTo:"mini_comment_to",IDcommentToAuthor:"mini_comment_to_author",IDcommentToSpan:"mini_comment_to_span",IDcommentToAuthorSpan:"mini_comment_to_author_span",IDfwdRoot:"mini_fwd_root",IDfwdStatus:"mini_fwd_status",IDemoPan:"mini_emotions",IDemoBtn:"mini_emo_btn",IDframe:"mini_frame",IDcounter:"mini_statusCount",IDerr:"mini_err",IDmsg:"mini_msg",CFGshowMax:false,TIPinputDefault:"\u4f60\u6b63\u5728\u5e72\u561b?",CFGshowError:false};
this.params=_5dc;
}
$extend(this,_5dc);
};
ns.miniFeed.prototype={skin:"http://s.xnimg.cn/csspro/module/status-pop.css",action:"http://status."+XN.env.domain+"/publisher/minifeed.do",msg:{mfBuildFail:"\u62b1\u6b49\uff0c\u670d\u52a1\u51fa\u9519\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u540e\u518d\u8bd5\u3002"},block:[],init:function(fn){
var This=this;
if(!this.initialized){
this.initialized=true;
if(this.standAlong){
this.addEvent("skinLoaded",function(){
This._loadSkeleton();
});
this._loadSkin();
}else{
This._loadSkeleton();
}
This.addEvent("skeletonLoaded",function(){
$(this.params.IDemotion).delClass("emotions");
This.statusEditor=new XN.APP.status.editor(This.params);
This.getUIRef();
This.bindEvent();
This.fireEvent("miniInitOver");
});
}
},bindEvent:function(){
var This=this;
this.statusEditor._onInputFocus=function(){
var _5e0=this.getEl("input");
_5e0.style.color="#333";
if(_5e0.value==this.getTip("inputDefault")){
_5e0.value="";
}
this._resetInputCounter();
$(_5e0).addClass("focus");
this.fireEvent("inputFocus");
};
this.statusEditor._onBlur=function(){
var This=this;
var _5e2=this.getEl("input");
$(_5e2).delClass("focus");
var v=_5e2.value;
if(this._overEmotion){
return;
}
This.simpleMode();
};
if(this.statusEditor){
this.statusEditor.addEvent("beforeUpdate",function(){
This._beforeUpdate();
});
this.statusEditor.addEvent("updateSuccess",function(msg,send,_5e6){
This._updateSuccess(msg,send,_5e6);
This.fireEvent("miniUpdateSus",_5e6);
});
this.statusEditor.addEvent("updateError",function(r){
This._updateError();
This.fireEvent("miniUpdateError",r);
});
}
},_loadSkeleton:function(){
var This=this;
var p={useCache:true};
new XN.net.xmlhttp({url:this.action,data:XN.array.toQueryString(p),onSuccess:function(r){
var temp=$(This.IDframe);
if(!temp){
temp=$element("div");
temp.id=This.IDframe;
temp.className="publisher";
document.body.appendChild(temp);
}
var txt=r.responseText;
if(XN.string.isJSON(txt)){
txt="\u6211\u52d2\u4e2a\u53bb\uff0c\u52a0\u8f7d\u5931\u8d25\u4e86\u3002\u91cd\u8bd5\u4e00\u4e0b\u6216\u8005\u5237\u65b0\u9875\u9762\u770b\u770b\u884c\u4e0d^_^";
}
temp.innerHTML=txt;
This.initPopup();
This.fireEvent("skeletonLoaded");
}});
},_beforeUpdate:function(){
this._disable();
var p={commentTo:this.commentTo.checked,commentToAuthor:this.commentToAuthor.checked};
this.statusEditor.addOnsParam(p);
},_updateSuccess:function(msg,send,_5f0){
this._reset();
var _5f1=send.indexOf("\u8f6c\u81ea");
var _5f2;
if(_5f1!=-1){
_5f2=send.slice(0,_5f1);
}else{
_5f2=send;
}
if(!_5f2){
return;
}
if(this.commentTo.checked){
var p={c:_5f2,source:this.fwd.statusId,t:3,owner:this.fwd.ownerId};
setTimeout(function(){
new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/feedcommentreply.do?from=wp",data:XN.array.toQueryString(p)});
},2000);
}
if(this.commentToAuthor.checked){
var p2={c:_5f2,source:this.fwd.fwdRootDoingId,t:3,owner:this.fwd.fwdRootId};
setTimeout(function(){
new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/feedcommentreply.do?from=wp",data:XN.array.toQueryString(p2)});
},13000);
}
},_updateError:function(){
this._reset();
},_reset:function(){
var _5f5=$(this.IDsubmit);
_5f5.delClass("disabled");
},_disable:function(){
var _5f6=$(this.IDsubmit);
_5f6.addClass("disabled");
_5f6.disable=false;
var inpt=$(this.IDinput);
inpt.disable=false;
},initPopup:function(){
var This=this;
this.popInited=true;
var div=$element("div");
var _5fa=$element("div");
_5fa.id="mini_meta";
if(XN.browser.IE6){
_5fa.style.cssText="margin-top:-20px;padding-left:66px;";
}
_5fa.innerHTML=["<p><a target=\"_blank\" href=\"#\" id=\"mini_fwd_root\"></a> : <span id=\"mini_fwd_status\"></span></p>","<div id=\"mini_target\"><label><input checked=\"checked\" id=\"mini_comment_to\" type=\"checkbox\"/>\u540c\u65f6\u8bc4\u8bba\u7ed9<span id=\"mini_comment_to_span\"></span></label></div>","<div style=\"height:16px;margin-top:7px\"><div id=\"mini_author\" style=\"margin-top:0px\"><label><input checked=\"checked\" id=\"mini_comment_to_author\" type=\"checkbox\"/>\u540c\u65f6\u8bc4\u8bba\u7ed9\u539f\u4f5c\u8005<span id=\"mini_comment_to_author_span\"></span></label></div></div>"].join("");
div.appendChild($(this.IDframe));
div.appendChild(_5fa);
XN.event.addEvent(document,"keydown",function(e){
e=e||window.event;
if(e.keyCode==27){
XN.APP.status.setForwardNull();
}
});
try{
window.currentDialog.remove();
}
catch(e){
}
this.pan=new XN.ui.dialog({title:"\u5206\u4eab",width:475,height:100,body:div.innerHTML,showCloseButton:true}).addButton({text:"\u786e\u5b9a",onclick:function(){
this.preventHide();
$("mini_submit").click();
}}).addButton({text:"\u53d6\u6d88",className:"gray",onclick:function(){
this.hide();
}}).show();
var p=this.pan;
window.currentDialog=this.pan;
$(this.IDsubmit).style.display="none";
$(this.IDinput).style.height="58px";
$(this.IDform).style.paddingRight="0px";
$(this.IDmeta).style.paddingRight="0px";
$(this.IDemoPan).style.right="15px";
$(this.IDemoPan).style.top="58px";
$(this.IDmeta).style.marginTop="10px";
$(this.IDinput).style.width=$(this.IDtools).style.width=$(this.IDmeta).style.width="350px";
if(XN.browser.IE){
$(this.IDform).style.width="373px";
$(this.IDemoPan).style.top="67px";
if(XN.browser.IE6){
$(this.IDmeta).style.marginTop="-20px";
}else{
$(this.IDmeta).style.marginTop="15px";
}
}
},getUIRef:function(){
this.commentTo=$(this.IDcommentTo);
this.commentToSpan=$(this.IDcommentToSpan);
this.commentToAuthor=$(this.IDcommentToAuthor);
this.commentToAuthorSpan=$(this.IDcommentToAuthorSpan);
this.fwdRoot=$(this.IDfwdRoot);
this.fwdStatus=$(this.IDfwdStatus);
this.authorDiv=$("mini_author");
this.targetDiv=$("mini_target");
},_skeleton:function(p){
},show:function(){
if(!this.popInited){
return;
}
this.pan.show();
if($(this.IDframe)){
$(this.IDframe).show();
}
if(this.statusEditor){
this.statusEditor.getEl("input").disabled=false;
this.statusEditor.hideErr();
this.statusEditor.hideMsg();
this.commentTo.checked=true;
this.commentToAuthor.checked=false;
var fwd=this.fwd;
if(!fwd.fwdRoot){
if(this.readonly){
this.targetDiv.hide();
this.authorDiv.hide();
}else{
this.targetDiv.show();
this.authorDiv.hide();
}
}else{
this.targetDiv.show();
if(this.readonly){
this.authorDiv.hide();
}else{
this.authorDiv.show();
}
}
this.commentToSpan.innerHTML=fwd.fwdTarget;
this.commentToAuthorSpan.innerHTML=fwd.fwdRoot||fwd.fwdTarget;
this.fwdRoot.innerHTML=fwd.fwdRoot||fwd.fwdTarget;
this.fwdRoot.href="http://www."+XN.env.domain+"/profile.do?id="+(fwd.fwdRootId||fwd.fwdTargetId);
this.fwdStatus.innerHTML=fwd.fwdRootStatus||fwd.status;
}
},hide:function(){
if(this.pan){
this.pan.hide();
}
},setStatus:function(_5ff,rt){
var This=this;
this.readonly=rt.readonly;
this.fwd=$extend({},rt);
var _602=this.statusEditor.getEl("input");
this.statusEditor.getEl("input").value=_5ff;
this.statusEditor._inputHelper.limitCheck();
var t=$(this.statusEditor.IDemoBtn);
if(t){
t.show();
}
setTimeout(function(){
setCursor2Start(This.statusEditor.getEl("input"));
},0);
},_loadSkin:function(){
var This=this;
XN.loadFile(this.skin,function(){
This.fireEvent("skinLoaded");
});
},_standAlong:function(fn){
var This=this;
}};
})(XN.widgets);
XN.event.enableCustomEvent(XN.widgets.miniFeed.prototype);
(function(ns){
var _608=240;
ns.FowardManager={fowardThis:function(_609,_60a,type,fn){
type=type||"status";
if(XN.string.isBlank(_609)&&XN.string.isBlank(_60a)){
return;
}
var _60d=[];
_60d["id"]=_609;
_60d["owner"]=_60a;
_60d["ref"]=type;
var self=arguments.callee;
try{
self.request.abort();
}
catch(e){
}
this.fireEvent("beforeFwd");
var This=this;
XN.dom.ready(function(){
self.request=new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/doing/fwdinfo.do",data:XN.array.toQueryString(_60d),method:"get",onSuccess:function(r){
if(fn){
fn.call(This,r);
}
},onError:function(){
XN.DO.showError("\u52a0\u8f7d\u5931\u8d25");
}});
});
},fowardDoing:function(_611,_612,_613,_614){
var type="status";
if(XN.string.isBlank(_611)&&XN.string.isBlank(_612)){
return;
}
var _616=[];
_616["id"]=_611;
_616["owner"]=_612;
_616["ref"]=type;
var self=arguments.callee;
try{
self.request.abort();
}
catch(e){
}
this.fireEvent("beforeFwd");
var This=this;
XN.dom.ready(function(){
self.request=new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/doing/fwdinfo.do",data:XN.array.toQueryString(_616),method:"get",onSuccess:function(r){
var rt=XN.json.parse(r.responseText);
if(rt.code==0){
if(rt.userName==undefined){
XN.DO.showError("\u8f6c\u53d1\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u91cd\u8bd5");
return;
}
var _61b="\u8f6c\u81ea";
if(rt.fwdRootStatus===undefined){
_61b+=rt.userName;
}else{
_61b+=(rt.userName+": "+rt.statusContent);
}
if(_61b.length>_608){
_61b=_61b.slice(0,_608-3)+"...";
}
XN.APP.status.setForwardTrue(_611,_612,type,_613,_614);
rt.ownerId=_612;
rt.statusId=_611;
rt.statID=_613;
rt.level=_614;
This.fireEvent("fwdSus",_61b,rt);
}else{
if(rt.code==10){
XN.DO.showError("\u4e0d\u80fd\u8f6c\u53d1\u81ea\u5df1\u7684\u72b6\u6001");
}else{
XN.DO.showError(rt.msg);
}
}
},onError:function(){
XN.DO.showError("\u52a0\u8f7d\u5931\u8d25");
}});
});
}};
})(XN.widgets);
XN.event.enableCustomEvent(XN.widgets.FowardManager);
XN.dom.ready(function(){
var regx=/http:\/\/status\.renren\.com/;
var href=document.location.href+"";
var _61e=false;
if(regx.test(href)){
_61e=true;
}
var _61f=new XN.widgets.miniFeed();
if(!_61e){
_61f.standAlong=true;
}
window.fwdmgr=XN.widgets.FowardManager;
fwdmgr.addEvent("fwdSus",function(_620,rt){
if(!_61f.initialized){
_61f.addEvent("miniInitOver",function(){
_61f.setStatus(_620,rt);
_61f.show();
});
_61f.init();
}else{
_61f.setStatus(_620,rt);
_61f.show();
}
});
_61f.addEvent("miniUpdateSus",function(){
var me=_61f.statusEditor;
me.showMsg("<span id=\"mini_msg_ok\" style=\"background:rgb(255,255,150);\">\u53d1\u5e03\u6210\u529f!</span>");
var m=$("mini_msg_ok");
setTimeout(function(){
XN.Effect.gradient(m,255,255,150,function(){
m.style.backgroundColor="transparent";
me.hideMsg();
setTimeout(function(){
_61f.hide();
},500);
});
},500);
});
_61f.addEvent("miniUpdateError",function(r){
var me=_61f.statusEditor;
me.getEl("submit").addClass("disabled");
me.simpleMode();
me.showErr(r);
if(_61f.readonly){
me.getEl("submit").delClass("disabled");
me.getEl("submit").disabled=false;
me.getEl("input").disabled=true;
setTimeout(function(){
me.hideErr();
},2000);
return;
}
setTimeout(function(){
me.getEl("submit").delClass("disabled");
me.getEl("submit").disabled=false;
me.getEl("input").disabled=false;
me._inputHelper.focus();
},2000);
});
window.a_fowardDoing=function(_626,_627,_628,_629){
fwdmgr.fowardDoing(_626,_627);
};
});
forwardDoing=function(_62a,_62b,_62c,_62d){
fwdmgr.fowardDoing(_62a,_62b,_62c,_62d);
};
XN.namespace("app");
XN.app.ILike=function(p){
$extend(this,p);
};
(function(ns){
var _630={};
var _631;
getILike=function(uidx){
return _630[uidx];
};
getActiveILike=function(){
return getILike(_631);
};
var send=function(args){
var sUrl=args.url;
var _636=args.method||"GET";
var _637=args.callback;
var _638=args.errorMsg||"\u672a\u77e5\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5";
var _639=args.data;
var s=this;
try{
new XN.net.xmlhttp({url:sUrl,data:_639,method:_636,onSuccess:function(r){
var jRsp=XN.JSON.parse(r.responseText);
if(jRsp.code!=0){
XN.DO.alert(jRsp.msg);
return;
}else{
_637.call(s,jRsp);
}
},onError:function(){
if(XN.DEBUG_MODE){
XN.DO.showError(_638);
}
}});
}
catch(e){
XN.log("\u6570\u636e\u53d1\u9001\u5931\u8d25");
}
};
ns.prototype={gid:0,uid:0,userLike:false,likeCount:null,likeList:[],ilikeButton:null,ilikeBox:null,ilikeHeader:null,ilikeDetailBox:null,baseUrl:"http://like."+XN.env.domain,addUrl:"/addlike",removeUrl:"/removelike",viewCountUrl:"/showlike",veiwDetailUrl:"/showlikedetail",urlProfile:"http://www."+XN.env.domain+"/profile.do",loadingStr:"<span id=\"temp-loading\">\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" /></span>",isDetailShow:false,oldDetailShow:null,guestName:null,ownerId:null,itemName:null,cookieNameHour:null,cookieNameDay:null,maxHourLikeCounts:30,maxDayLikeCounts:80,hourAlertMsg:"\u60a8\u559c\u6b22\u7684\u6b21\u6570\u592a\u591a\u4e86\uff0c\u8bf7\u4f11\u606f\u4e00\u5c0f\u65f6\u518d\u559c\u6b22\u5427\uff01",dayAlertMsg:"\u60a8\u4eca\u5929\u559c\u6b22\u7684\u6b21\u6570\u592a\u591a\u4e86\uff0c\u8bf7\u660e\u5929\u518d\u559c\u6b22\u5427\uff01",lastLikeTime:null,limitInteval:3,limitAlertMsg:"\u60a8\u7684\u64cd\u4f5c\u592a\u5feb\u4e86\uff0c\u8bf7\u7a0d\u540e\u518d\u91cd\u8bd5",init:function(){
if(isUndefined(this.type)||isUndefined(this.id)||isUndefined(this.userId)){
XN.log("type|id|userId must needed!!");
return false;
}
this.gid=this.type+"_"+this.id;
this.uid=this.userId;
this.params={gid:this.gid,uid:this.uid};
_630[this.gid]=this;
_631=this.gid;
this.cookieNameHour="IL_H";
this.cookieNameDay="IL_D";
},add:function(){
var _63d;
switch(this.type){
case "blog":
_63d=0;
break;
case "album":
_63d=1;
break;
case "photo":
_63d=2;
break;
case "share":
_63d=3;
break;
case "edm":
_63d=4;
break;
case "video":
_63d=5;
break;
}
var _63e=$extend(this.params,{owner:this.ownerId,type:_63d,name:this.guestName});
var url=this.getUrl(this.addUrl,_63e);
this.fireEvent("startAdd");
var c=this.checkHasLiked();
if(c.alreadyMax){
XN.DO.alert(c.msg);
return false;
}
if(!this.checkActionInteval()){
if(this.actionIntevalCallBack){
this.actionIntevalCallBack();
}else{
XN.DO.showError(this.limitAlertMsg);
}
return false;
}
send.call(this,{url:url,callback:this.addCallback});
},addCallback:function(o){
XN.log(o);
this.likeCount=o.likeCount;
this.userLike=o.ownerLike;
this.likeList=o.likeList;
this.setCheckCookie();
this.fireEvent("addSuccess");
},remove:function(){
var url=this.getUrl(this.removeUrl,this.params);
this.fireEvent("remove");
var c=this.checkHasLiked();
if(c.alreadyMax){
XN.DO.alert(c.msg);
return false;
}
if(!this.checkActionInteval()){
if(this.actionIntevalCallBack){
this.actionIntevalCallBack();
}else{
XN.DO.showError(this.limitAlertMsg);
}
return false;
}
send.call(this,{url:url,callback:this.removeCallback});
},removeCallback:function(o){
XN.log(o);
this.likeCount=o.likeCount;
this.userLike=o.ownerLike;
this.likeList=o.likeList;
this.setCheckCookie();
this.fireEvent("removeSuccess");
},viewCount:function(){
var url=this.getUrl(this.viewCountUrl,this.params);
this.fireEvent("getViewCount");
if(getILike(this.gid).likeCount!=null){
this.fireEvent("getViewCountSuccess");
return false;
}
send.call(this,{url:url,callback:this.viewCountCallback});
},viewCountCallback:function(o){
XN.log(o);
this.likeCount=o.likeCount;
this.userLike=o.ownerLike;
this.fireEvent("getViewCountSuccess");
},viewDetail:function(){
var url=this.getUrl(this.veiwDetailUrl,this.params);
this.fireEvent("getViewDetail");
if(this.likeList.length!=0){
this.fireEvent("getViewDetailSuccess");
return;
}
send.call(this,{url:url,callback:this.veiwDetailCallback});
this.addLoading();
},veiwDetailCallback:function(o){
XN.log(o);
this.likeCount=o.likeCount;
this.userLike=o.ownerLike;
this.likeList=o.likeList;
this.removeLoading();
this.fireEvent("getViewDetailSuccess");
},getUrl:function(sUrl,_64a){
$extend(_64a,{t:Math.random()});
return this.baseUrl+sUrl+"?"+XN.array.toQueryString(_64a);
},setCheckCookie:function(){
this.setHourLiked();
this.setDayLiked();
},setCookie:function(name,_64c,_64d,path,_64f,_650){
var _651;
if(isNumber(_64d)){
var date=new Date();
var _653=new Date(date.getTime()+(_64d*1000));
_651=_653.toGMTString();
}else{
if(isString(_64d)){
_651=_64d;
}else{
_651=false;
}
}
_64f=_64f||XN.env.domain;
path="/";
document.cookie=name+"="+encodeURIComponent(_64c)+(_651?";expires="+_651:"")+(path?";path="+path:"")+(_64f?";domain="+_64f:"")+(_650?";secure":"");
},setHourLiked:function(){
var _654=60-new Date().getMinutes();
if(!(!!XN.cookie.get(this.cookieNameHour))){
this.setCookie(this.cookieNameHour,1,_654*60);
}else{
var _655=parseInt(XN.cookie.get(this.cookieNameHour));
this.setCookie(this.cookieNameHour,_655+1,_654*60);
}
},setDayLiked:function(){
var date=new Date();
date.setDate(date.getDate()+1);
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
var _657=date.getTime()-new Date().getTime();
if(!XN.cookie.get(this.cookieNameDay)){
this.setCookie(this.cookieNameDay,1,_657/1000);
}else{
var _658=parseInt(XN.cookie.get(this.cookieNameDay));
this.setCookie(this.cookieNameDay,_658+1,_657/1000);
}
},checkHourLiked:function(){
var _659=parseInt(XN.cookie.get(this.cookieNameHour));
return _659>this.maxHourLikeCounts;
},chekcDayLiked:function(){
var _65a=parseInt(XN.cookie.get(this.cookieNameDay));
return _65a>this.maxDayLikeCounts;
},checkHasLiked:function(){
if(this.checkHourLiked()){
return {alreadyMax:true,msg:this.hourAlertMsg};
}
if(this.chekcDayLiked()){
return {alreadyMax:true,msg:this.dayAlertMsg};
}
return {alreadyMax:false};
},checkActionInteval:function(){
if(!this.lastLikeTime){
this.lastLikeTime=new Date().getTime();
return true;
}else{
var _d=new Date().getTime();
var _t=(_d-this.lastLikeTime)/1000;
this.lastLikeTime=_d;
return _t>this.limitInteval;
}
},addLoading:function(){
if(!$("temp-loading")){
this.ilikeHeader.innerHTML+=this.loadingStr;
}
},removeLoading:function(){
var _65d=this.ilikeHeader.getElementsByTagName("span")[0];
if(_65d){
this.ilikeHeader.removeChild(_65d);
}
},elShow:function(el){
el.style.display="";
},elHide:function(el){
el.style.dispay="none";
}};
XN.EVENT.enableCustomEvent(ns.prototype);
})(XN.app.ILike);
var ILike={ilike:null,init:function(p){
var s=this;
var gid=p.type+"_"+p.id;
if(!!getILike(gid)){
this.ilike=getILike(gid);
}else{
this.ilike=new XN.app.ILike(p);
}
XN.log(this.ilike.likeCount);
this.ilike.init();
this.ilike.addEvent("getViewCountSuccess",function(){
s.renderButton();
s.renderHeaderBox();
});
if(this.ilike.ilikeBox){
delete this.ilike.ilikeBox;
}
this.createBox();
this.ilike.isDetailShow=false;
this.ilike.guestName=$("guestName").value||p.guestName;
this.ilike.viewCount();
this.inputParams=p;
try{
if(Blog){
Blog.addEvent("onShowMoreComments",function(){
ILike.patchShowMoreComments();
});
}
}
catch(e){
}
try{
if(AlbumComments&&AlbumComments.albumId){
AlbumComments.addEvent("onShowMoreComments",function(){
ILike.patchShowMoreComments();
});
}
}
catch(e){
}
try{
if(XN.PAGE.albumPhoto&&XN.PAGE.albumPhoto.currentPhotoId){
XN.PAGE.albumPhoto.addEvent("onShowMoreComments",function(){
ILike.patchShowMoreComments();
});
XN.PAGE.albumPhoto.addEvent("onPhotoRefresh",ILike.patchPhotoRefresh);
}
}
catch(e){
}
},toggleUserLike:function(){
var il=this.ilike;
var s=this;
if(il.userLike==false){
il.addEvent("addSuccess",function(){
s.renderAll();
});
il.add();
}else{
il.addEvent("removeSuccess",function(){
s.renderAll();
});
il.remove();
}
},toggleShowDetail:function(){
var il=this.ilike;
var s=this;
if(il.isDetailShow===true){
il.ilikeDetailBox.style.display="none";
}else{
il.addEvent("getViewDetailSuccess",function(){
s.renderLikeList();
});
il.viewDetail();
}
il.isDetailShow=il.isDetailShow===true?false:true;
},renderAll:function(){
var s=this;
var il=this.ilike;
s.renderButton();
s.renderHeaderBox();
if(il.isDetailShow){
s.renderLikeList();
}
},renderButton:function(){
var il=this.ilike;
if(il.userLike==true){
il.ilikeButton.innerHTML="\u53d6\u6d88";
}else{
il.ilikeButton.innerHTML="\u559c\u6b22";
}
if(il.ilikeButtonAddtional){
if(il.userLike==true){
il.ilikeButtonAddtional.innerHTML="\u53d6\u6d88";
}else{
il.ilikeButtonAddtional.innerHTML="\u559c\u6b22";
}
}
},renderHeaderBox:function(){
var il=this.ilike;
var _66b;
var tmpT;
var _66d="ILike.toggleShowDetail();return false;";
if(il.likeCount>0){
if(il.userLike===true){
if(il.likeCount-1>0){
_66b="<a onclick=\""+_66d+"\" href=\"javascript:;\">\u6211\u548c"+(il.likeCount-1)+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01</a>";
}
if((il.likeCount-1)==0){
_66b="\u6211\u5f88\u559c\u6b22\uff01";
}
}else{
_66b="<a onclick=\""+_66d+"\" href=\"javascript:;\">"+il.likeCount+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01</a>";
}
}
if(!!_66b){
il.ilikeHeader.parentNode.style.display="block";
il.ilikeHeader.innerHTML=_66b;
}else{
il.ilikeHeader.parentNode.style.display="none";
}
},renderLikeList:function(){
var il=this.ilike;
var _66f=il.likeList;
var html="<ul class=\"figures\">";
for(var i=0,l=_66f.length;i<l;i++){
var _673=_66f[i].keepUse?" lively-user":"";
var _674=_66f[i].keepUse?"\u8fde\u7eed\u767b\u5f557\u5929, \u5373\u53ef\u83b7\u5f97\u6a59\u540d\u7279\u6743":_66f[i].name;
html+=["<li><div class=\"figure\">","<a href=\""+il.urlProfile+"?id="+_66f[i].id+"\" target=\"_blank\">","<img src=\""+_66f[i].headUrl+"\" alt=\""+_66f[i].name+"\" />","</a>","<div class=\"label name\">","<a href=\""+il.urlProfile+"?id="+_66f[i].id+"\" class=\""+_673+"\" title=\""+_674+"\" target=\"_blank\">"+_66f[i].name+"</a>","</div>","</div></li>"].join("");
}
html+="</ul>";
il.ilikeDetailBox.innerHTML=html;
il.ilikeDetailBox.style.display="block";
},createBox:function(){
if($("ILike_Box")){
$("ILike_Box").parentNode.removeChild($("ILike_Box"));
}
this.ilike.ilikeBox=document.createElement("dl");
this.ilike.ilikeBox.id="ILike_Box";
var html=["<dt class = \"digged\" style=\"display:none;\">","<span  id=\"ILike_Text_"+this.ilike.id+"\">","</span>","</dt>","<dd id=\"ILike_Detail_"+this.ilike.id+"\" class = \"diggers\" style=\"display:none;\"></dd>"].join("");
this.ilike.ilikeBox.innerHTML=html;
this.ilike.ilikeBox.className="replies  with-arrow";
var _676=XN.dom.getElementsByClassName("replies","document","dl")[0];
if(_676!=undefined){
_676.className=_676.className.replace(/\swith-arrow/ig,"");
_676.parentNode.insertBefore(this.ilike.ilikeBox,_676);
}else{
XN.dom.getElementsByClassName("replies","document","div")[0].appendChild(this.ilike.ilikeBox);
}
this.getHTMLhandles();
},getHTMLhandles:function(){
this.ilike.ilikeButton=$("ILike_UserLike_Handle");
if($("photoGood")){
this.ilike.ilikeButtonAddtional=$("photoGood");
}
this.ilike.ilikeHeader=$("ILike_Text_"+this.ilike.id);
this.ilike.ilikeDetailBox=$("ILike_Detail_"+this.ilike.id);
},patchShowMoreComments:function(){
this.createBox();
this.renderAll();
},patchPhotoRefresh:function(pid){
XN.page.albumPhoto.delEvent("onPhotoRefresh",ILike.patchPhotoRefresh);
ILike.inputParams.id=pid;
ILike.init(ILike.inputParams);
}};
(function(){
var _678=function(gid){
var il=getILike(gid);
var _67b=il.likeList;
var html="";
for(var i=0,l=_67b.length;i<l;i++){
var _67f=_67b[i].keepUse?" lively-user":"";
var _680=_67b[i].keepUse?"\u8fde\u7eed\u767b\u5f557\u5929, \u5373\u53ef\u83b7\u5f97\u6a59\u540d\u7279\u6743":_67b[i].name;
html+=["<li>","<a href=\""+il.urlProfile+"?id="+_67b[i].id+"\" target=\"_blank\">","<img src=\""+_67b[i].headUrl+"\" alt=\""+_67b[i].name+"\" />","</a>","<div class=\"label name\">","<a href=\""+il.urlProfile+"?id="+_67b[i].id+"\" class=\""+_67f+"\" title=\""+_680+"\" target=\"_blank\">"+_67b[i].name+"</a>","</div>","</li>"].join("");
}
il.ilikeDetailBox.innerHTML=html;
il.ilikeDetailBox.style.display="block";
};
var _681=function(gid){
var il=getILike(gid);
if(il.userLike==true){
il.ilikeButton.innerHTML="\u53d6\u6d88";
}else{
il.ilikeButton.innerHTML="\u559c\u6b22";
}
};
var _684=function(gid){
var il=getILike(gid);
var _687;
if(il.likeCount>0){
if(il.userLike===true){
if(il.likeCount-1>0){
_687="<a href=\"javascript:;\" onclick=\"ILike_toggleShow('"+il.type+"',"+il.id+","+il.userId+")\" href=\"javascript:;\">\u6211\u548c"+(il.likeCount-1)+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01</a>";
}
if((il.likeCount-1)==0){
_687="\u6211\u5f88\u559c\u6b22\uff01";
}
}else{
_687="<a onclick=\"ILike_toggleShow('"+il.type+"','"+il.id+"',"+il.userId+")\" href=\"javascript:;\">"+il.likeCount+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01";
}
}
if(!!_687){
il.ilikeHeader.parentNode.style.display="block";
il.ilikeHeader.innerHTML=_687;
}else{
il.ilikeHeader.parentNode.style.display="none";
}
};
var _688=function(gid){
var il=getILike(gid);
_681(gid);
_684(gid);
if(il.isDetailShow){
_678(gid);
}
};
ILike_createBox=function(p){
var str="";
var _68d="none";
var _68e="";
p.digged=isNaN(p.digged)?0:p.digged;
if(p.digged&&!p.userDigged){
str="<a href=\"javascript:;\" onclick=\"ILike_toggleShow('"+p.type+"','"+p.id+"','"+p.userId+"')\">"+p.digged+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01</a>";
}else{
if(p.digged&&p.userDigged){
str="<a href=\"javascript:;\" onclick=\"ILike_toggleShow('"+p.type+"','"+p.id+"','"+p.userId+"')\">\u6211\u548c"+p.digged+"\u4e2a\u4eba\u5f88\u559c\u6b22\uff01</a>";
}else{
if(!p.digged&&p.userDigged){
str="\u6211\u5f88\u559c\u6b22\uff01";
}
}
}
if(p.digged||p.userDigged){
_68d="block";
}
_68e+="<div class=\"mincmt-diggers statuscmtitem\" style=\"display:"+_68d+"\">";
_68e+="<p>"+str+"</p>";
_68e+="<ul id=\"diggers"+p.id+"\" class=\"digger\"></ul>";
_68e+="</div>";
if(!getILike(p.type+"_"+p.id)){
var _68f=XN.cookie.get("id");
var _690=new XN.app.ILike({type:p.type,id:p.id,ownerId:p.ownerId,likeCount:p.digged,userLike:!!p.userDigged,userId:_68f});
_690.init();
}
return _68e;
};
ILike_toggleUserLike=function(type,id,_693,_694,_695){
var il=getILike(type+"_"+id);
var _697=$("feedbody"+id)||$("share_ilike_"+id);
il.ilikeButton=$("ILike"+id);
il.ilikeHeader=XN.dom.getElementsByClassName("mincmt-diggers",_697)[0].getElementsByTagName("p")[0];
il.ilikeDetailBox=$("diggers"+id);
il.ownerId=_694;
il.guestName=_695;
if(il.userLike==true){
il.addEvent("removeSuccess",function(){
_688(il.gid);
if($("XILike"+id)){
$("XILike"+id).className="ilike-link";
$("XILike"+id).innerHTML="\u559c\u6b22";
}
});
il.remove();
}else{
il.addEvent("addSuccess",function(){
_688(il.gid);
if($("XILike"+id)){
$("XILike"+id).innerHTML="\u53d6\u6d88";
}
});
il.add();
}
};
ILike_toggleShow=function(type,id,_69a){
var il=getILike(type+"_"+id);
il.ilikeButton=$("ILike"+id);
il.ilikeHeader=XN.dom.getElementsByClassName("mincmt-diggers",$("feedbody"+id))[0].getElementsByTagName("p")[0];
il.ilikeDetailBox=$("diggers"+id);
if(il.isDetailShow===true){
il.ilikeDetailBox.style.display="none";
}else{
il.addEvent("getViewDetailSuccess",function(){
_678(il.gid);
});
il.viewDetail();
}
il.isDetailShow=il.isDetailShow===true?false:true;
};
})();
try{
if(XN.APP.status&&!window.ilike_listen_status){
XN.APP.status.addEvent("ILikeInit",function(html,type,id,_69f,_6a0,_6a1,_6a2){
if(type=="blog"||type=="album"||type=="photo"||type=="share"||type=="edm"){
var _6a3=type;
if(_6a2&&(_6a2=="share_edm")){
_6a3="edm";
}
var _6a4=ILike_createBox({type:_6a3,id:id,ownerId:_69f,digged:_6a0,userDigged:_6a1});
html.push(_6a4);
}
});
window.ilike_listen_status=true;
}
}
catch(e){
}
if(XN.PAGE.profile){
XN.PAGE.profile=null;
}
XN.PAGE.profile={commentsC:"talk",initComments:function(){
if(!$("cmtbody")){
return;
}
window.refreshCode=function(){
commentPost.changeVerifyCode();
};
this.commentsC=$(this.commentsC);
var _6a5=XN.DOM.getElementsByClassName("arrow",this.commentsC);
var bar,m;
for(var i=0,j=_6a5.length;i<j;i++){
bar=_6a5[i];
m=(bar.nextSibling.nodeType==3)?bar.nextSibling.nextSibling:bar.nextSibling;
new XN.UI.menu({bar:bar,fireOn:"mouseover",offsetY:-1,alignType:"3-2",menu:m,keep:0.1});
}
},initTips:function(){
if(!$("newbieGuide")){
return;
}
if(!XN.Cookie.get("isProfileGuide")){
$("newbieGuide").show("fade");
}
window.showTip=function(t){
if(t==0){
$("newbieGuide").hide();
XN.Cookie.set("isProfileGuide","1");
return;
}
$("newTip"+t).show();
t--;
$("newTip"+t).hide();
};
},init:function(){
this.initComments();
}};
XN.DOM.readyDo(function(){
if($("profile")||$("userInfo")){
XN.Page.profile.init();
}
});
function ajaxDelFriend(id,name){
function sendRemove(id,name,code,flag){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/DelFriend.do",data:"id="+id+"&code="+code+"&codeFlag="+flag,method:"post",onSuccess:function(r){
try{
var data=XN.JSON.parse(r.responseText);
if(data.ret==0){
XN.DO.showMessage("\u8bf7\u6c42\u5df2\u751f\u6548\uff0c\u7a0d\u540e\u4f60\u4eec\u7684\u597d\u53cb\u5173\u7cfb\u4f1a\u81ea\u52a8\u89e3\u9664");
setTimeout(function(){
location.href="http://www."+XN.env.domain+"/Home.do";
},2000);
}else{
throw data.ret;
}
}
catch(e){
XN.DO.showError(e==-1?"\u9a8c\u8bc1\u7801\u9519\u8bef":"\u5220\u9664\u597d\u53cb\u5931\u8d25");
}
},onError:function(){
XN.DO.showError("\u5220\u9664\u597d\u53cb\u5931\u8d25");
}});
}
var flag=0;
var _6b4=XN.DO.confirm({title:"\u89e3\u9664\u597d\u53cb\u5173\u7cfb",modal:true,message:"<b>Loading...</b>",callBack:function(r){
if(r){
sendRemove(id,name,($("verifyCode")?$("verifyCode").value:null),flag);
}
}});
_6b4.footer.hide();
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/BeforeDeleteFriend.do",data:"temp="+new Date().getTime(),method:"post",onSuccess:function(r){
try{
var data=XN.JSON.parse(r.responseText);
flag=data.code;
if(flag==1){
_6b4.setBody("\u786e\u5b9a\u548c<b>\""+name+"\"</b>\u89e3\u9664\u597d\u53cb\u5173\u7cfb\u5417\uff1f<table><tbody><tr><td>\u9a8c\u8bc1\u7801:<input type=\"text\"class=\"inputtext\" id=\"verifyCode\"/></td><td><img id=\"verify_code_img\" src=\"http://icode."+XN.env.domain+"/getcode.do?t=delfriend_&temp="+(new Date().getTime())+"\" style=\"display:block;vertical-align:baseline;margin-left:5px;width:123px;height:46px;\" /><a href=\"javascript:;\" onclick=\"$('verify_code_img').src='http://icode."+XN.env.domain+"/getcode.do?t=delfriend_&r='+Math.random();return false;\">\u770b\u4e0d\u6e05\u6216\u770b\u4e0d\u89c1\uff1f\u6362\u4e00\u5f20</a></td></tbody></tabel>");
_6b4.footer.show();
}else{
if(flag==0){
_6b4.setBody("\u786e\u5b9a\u548c<b>\""+name+"\"</b>\u89e3\u9664\u597d\u53cb\u5173\u7cfb\u5417\uff1f");
_6b4.footer.show();
}else{
_6b4.hide();
XN.DO.showError("\u670d\u52a1\u5668\u5f02\u5e38,\u8bf7\u7a0d\u540e\u518d\u8bd5!");
}
}
}
catch(e){
XN.DO.showError("\u670d\u52a1\u5668\u5f02\u5e38,\u8bf7\u7a0d\u540e\u518d\u8bd5!");
}
},onError:function(){
XN.DO.showError("\u670d\u52a1\u5668\u5f02\u5e38,\u8bf7\u7a0d\u540e\u518d\u8bd5!");
}});
}
function profilePage_ajaxUploadPhoto(){
if($("userpic_form_box")){
userpic_showDialog();
return;
}
var _6b8,tsc,_6ba;
try{
new XN.NET.xmlhttp({url:"http://head.upload."+XN.env.domain+"/profile/AjaxCertificate.do",onSuccess:function(r){
var m=XN.JSON.parse(r.responseText);
createUploadDialog(m.hostid,m.tsc,XN.cookie.get("societyguester"));
addSelectEvent();
},onError:function(){
XN.DO.showError("\u670d\u52a1\u5668\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5");
return;
}});
}
catch(e){
XN.DO.showError("\u670d\u52a1\u5668\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5");
return;
}
var _6bd;
function createUploadDialog(_6be,tsc,_6c0){
_6bd=new XN.ui.dialog().setTitle("\u4e0a\u4f20\u672c\u4eba\u5934\u50cf").setBody(["<div id=\"userpic_form_box\">","<div>\u9009\u62e9\u7535\u8111\u91cc\u7684\u4e00\u5f20\u76f8\u7247</div>","<form id=\"userpic_form\" method=\"POST\" target=\"userpic_quick_upload\" enctype=\"multipart/form-data\" action=\"http://head2.upload."+XN.env.domain+"/profile/FileUpload.do\">","<input type=\"file\" name=\"Filedata\"  id=\"Filedata\" />","<input type=\"hidden\" name=\"hostid\" value=\""+_6be+"\" />","<input type=\"hidden\" name=\"tsc\" value=\""+tsc+"\" />","<input type=\"hidden\" name=\"op\" value=\"upload\" />","<input type=\"hidden\" name=\"societyguester\" value=\""+_6c0+"\" />","</form>","<div id=\"userpic_error_show\">\u652f\u6301JPG\u3001JPEG\u3001GIF\u548cPNG\u6587\u4ef6\uff0c\u6700\u59274M</div>","</div>","<div id=\"userpic_loading_box\" style=\"display:none;margin: 0pt auto;line-height:32px;text-align:center;\">","<img src=\""+XN.env.staticRoot+"imgpro/indicator/blue_large.gif\" />","</div>","<iframe name=\"userpic_quick_upload\" src=\"http://"+XN.env.domain+"/ajaxProxy.html\" style=\"display:none;\"/>"].join("")).addButton({text:"\u53d6\u6d88",onclick:function(){
this.hide("fade");
}}).show("fade");
window.userpic_removeDialog=function(){
_6bd.hide();
};
window.userpic_showDialog=function(){
_6bd.show();
};
window.userpic_onUploadSuccess=function(code,msg,_6c3){
if(code==1){
userpic_removeDialog();
$("userpic").src=_6c3;
userpic_resetDialog();
}else{
userpic_resetDialog();
userpic_removeDialog();
XN.DO.showError(msg);
}
};
window.userpic_resetDialog=function(){
$("userpic_form_box").style.display="block";
$("userpic_loading_box").style.display="none";
$("Filedata").value="";
var _6c4=_6bd.getButton("\u53d6\u6d88").getEl();
_6c4.disabled=false;
_6c4.className=_6c4.className.replace(/\sgray/g,"");
};
}
function addSelectEvent(){
XN.event.addEvent($("Filedata"),"change",function(e){
var v=$("Filedata").value;
if(!/\.(png|jpg|jpeg|gif|bmp)/i.test(v)){
$("userpic_error_show").className="errors_div ajax_msgerror";
$("userpic_error_show").innerHTML="\u8bf7\u9009\u62e9\u4e00\u5f20\u56fe\u7247";
return;
}
$("userpic_form_box").style.display="none";
$("userpic_form").submit();
var _6c7=_6bd.getButton("\u53d6\u6d88").getEl();
_6c7.disabled=true;
_6c7.className+=" gray";
$("userpic_loading_box").style.display="block";
});
}
}
XN.dom.readyDo(function(){
try{
if(XN.cookie.get("id")!=(XN.string.getQuery("id")||XN.profile_owner)){
return;
}
headPic=$("userpic").parentNode;
if(headPic){
XN.event.addEvent(headPic.parentNode,"mouseover",function(){
$("linkHander").parentNode.style.display="block";
});
XN.event.addEvent(headPic.parentNode,"mouseout",function(){
$("linkHander").parentNode.style.display="none";
});
var _6c8=document.createElement("span");
var _6c9="<a stats=\"pf_headedit\" href=\"#nogo\" id=\"linkHander\" >\u4fee\u6539\u5934\u50cf</a>";
_6c8.innerHTML=_6c9;
_6c8.style.display="none";
headPic.parentNode.appendChild(_6c8);
XN.event.addEvent($("linkHander"),"click",profilePage_ajaxUploadPhoto);
}
}
catch(e){
}
});
function submitRealName(){
XN.DO.confirm({title:"\u63d0\u4ea4\u771f\u5b9e\u59d3\u540d",msg:"<label><span style=\"display:inline-block;width:60px;\">\u59d3&nbsp;&nbsp;&nbsp;\u540d\uff1a</span><input type=\"text\" id=\"realName\" class=\"input-text\" /></label><p style=\"color:#555;margin-top:10px;line-height:1.4em;\">"+XN.env.siteName+"\u662f\u771f\u5b9e\u7684\u793e\u4ea4\u793e\u533a\uff0c\u586b\u5199\u771f\u5b9e\u59d3\u540d\uff0c\u670b\u53cb\u624d\u80fd\u627e\u5230\u4f60\u3002\u4f7f\u7528\u7f51\u540d\u3001\u7ef0\u53f7\u3001\u5047\u540d\u3001\u82f1\u6587\u540d\u5c06\u4e0d\u4f1a\u88ab\u5ba1\u6838\u901a\u8fc7\uff0c\u53ea\u6709\u5ba1\u6838\u901a\u8fc7\u7684\u59d3\u540d\u624d\u80fd\u4fee\u6539\u6210\u529f\u3002\u6bcf\u5e74\u6709\u4e00\u6b21\u901a\u8fc7\u5ba1\u6838\u7684\u673a\u4f1a\u3002<br />\u661f\u7ea7\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u6635\u79f0\u529f\u80fd\u3002</p>",callBack:function(_6ca){
if(_6ca==true){
if(!$("realName").value){
XN.DO.showError("\u8bf7\u586b\u5199\u771f\u5b9e\u59d3\u540d");
return;
}
new XN.net.xmlhttp({url:"/AjaxModifyName.do?ref=home&name="+encodeURIComponent($("realName").value),onSuccess:function(r){
eval("rt="+r.responseText);
if(rt.status==0){
XN.DO.showMessage(rt.msg);
}else{
XN.DO.showError(rt.msg);
}
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u9519\u8bef\uff01");
}});
}
}});
}
XN.dom.ready(function(){
if(!$("uploadPhotoButton")){
return;
}
var _6cc=new SWFUpload({flash_url:"http://s.xnimg.cn/jspro/swfupload.v2.2.0.1/swfupload.swf",upload_url:"http://head2.upload."+XN.env.domain+"/home/FileUpload.do?ref=home&societyguester="+XN.cookie.get("societyguester")+"&hostid="+XN.cookie.get("id")+"&t="+XN.cookie.get("t"),file_types:"*.jpg;*.jpeg;*.png;*.bmp;*.gif",button_placeholder_id:"uploadPhotoButton",button_action:SWFUpload.BUTTON_ACTION.SELECT_FILE,button_width:170,button_height:45,button_image_url:"http://s.xnimg.cn/a.gif",button_cursor:SWFUpload.CURSOR.HAND,button_text:"<span>"+$("uploadPhotoButton").innerHTML+"</span>",button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,file_types:"*.jpg;*.jpeg;*.png;*.bmp;*.gif",file_types_description:"All Image Files",upload_success_handler:function(file,r){
var data=XN.JSON.parse(r);
if(data.code==1){
XN.DO.showMessage("\u60a8\u7684\u5934\u50cf\u5df2\u7ecf\u6210\u529f\u4e0a\u4f20\uff0c\u8bf7\u7b49\u5f85\u5ba1\u6838\u3002","\u63d0\u793a",2);
}else{
alert(data.msg);
}
},file_queued_handler:function(file){
var _6d1=this;
new XN.NET.xmlhttp({url:"http://head.upload."+XN.env.domain+"/profile/AjaxCertificate.do",onSuccess:function(r){
var m=XN.JSON.parse(r.responseText);
_6d1.setPostParams({hostid:m.hostid,tsc:m.tsc,societyguester:XN.cookie.get("societyguester")});
_6d1.startUpload();
},onError:function(e){
XN.DO.showError("\u670d\u52a1\u5668\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\u3002");
return;
}});
},upload_error_handler:function(file,code,_6d7){
alert(_6d7);
}});
});
function changeActivityIcon(src){
iconEle=$("activity-icon");
if(iconEle){
iconEle.src=src;
}
}
function changeSpringIcon(){
$("activity-icon").src="http://a.xnimg.cn/imgpro/icons/chinese-fu2.gif";
}
function OpenNewWin(url){
var frm=document.createElement("form");
frm.method="POST";
frm.target="_blank";
frm.action=url;
document.body.appendChild(frm);
frm.submit();
}
(function(){
var _6db=0;
var _6dc=null;
function showFriendSelect(conf){
var ELID="cross_page_multiFriendSelector"+_6db;
_6db++;
var _6df=XN.DO.alert({title:conf.title,msg:"<div id=\""+ELID+"\"></div>",width:500,yes:"\u5173\u95ed",callBack:function(r){
}});
_6df.hide();
try{
var s=new XN.ui.multiFriendSelectorBoxForProfile({createInputElements:false,url:conf.url+"?t="+Math.random(),noFilter:true,autoLoad:false,noCompleteButton:true,noCancelButton:true,noSearchInput:true,noTabView:true,param:{guest:conf.uids},friendsCountPerPage:30});
s.addEvent("load",function(){
if(!s._friendsCount){
if(isFunction(conf.noUser)){
conf.noUser();
}
_6df.hide();
return;
}
_6df.show();
});
s.addEvent("noFriends",function(){
if(isFunction(conf.noUser)){
conf.noUser();
}
_6df.hide();
});
$(ELID).setContent(s);
s.loadFriends();
}
catch(e){
_6df.hide();
}
}
showShareFriends=function(id){
var _6e3=function(){
showFriendSelect({uids:id,url:"http://friend."+XN.env.domain+"/shareFriends",title:"\u4f60\u4eec\u7684\u5171\u540c\u597d\u53cb"});
};
_6dc="sg_friendumayknow";
initFile(_6e3);
};
showProfileFriends=function(id){
var _6e5=function(){
showFriendSelect({uids:id,url:"http://friend."+XN.env.domain+"/otherFriends",title:"TA\u7684\u597d\u53cb"});
};
_6dc="sg_guide_friendlist";
initFile(_6e5);
};
function initFile(_6e6){
XN.loadFiles(["http://s.xnimg.cn/csspro/module/friendSelector.css","http://s.xnimg.cn/jspro/xn.ui.multiFriendSelectorBox.js","http://s.xnimg.cn/jspro/xn.ui.pager.js"],function(){
XN.ui.multiFriendSelectorBoxForProfile=function(p){
var This=this;
XN.ui.multiFriendSelectorBox.call(this,p);
this.config.selectedClassName="no_select_class";
};
XN.ui.multiFriendSelectorBoxForProfile.prototype=$extend({},XN.ui.multiFriendSelectorBox.prototype);
XN.ui.multiFriendSelectorBoxForProfile.prototype.deselect=function(){
};
XN.ui.multiFriendSelectorBoxForProfile.prototype.buildFriendInnerHTML=function(p){
return "<div style=\"padding: 4px; height: 64px; width: 134px;\"><a class=\"picbox\" style=\"border: 1px solid rgb(177, 193, 225); padding: 2px; display: block; float: left; margin-right: 3px; height: 50px;background:url(none)\" onclick=\"location.href='http://www."+XN.env.domain+"/profile.do?pma=p_profile_m_pub_sharefriendsall_a_profile&id="+p.id+"'\" href=\"http://www."+XN.env.domain+"/profile.do?id="+p.id+"\"\"><span class=\"pic\" style=\"background-image: url("+p.head+"); width: 50px; height: 50px; display: block;\"></span></a><h4 style=\"padding-left: 60px;\"><a style=\"height: 12px;background:url(none)\" onclick=\"location.href='http://www."+XN.env.domain+"/profile.do?pma=p_profile_m_pub_sharefriendsall_a_profile&id="+p.id+"'\" href=\"http://www."+XN.env.domain+"/profile.do?id="+p.id+"\">"+p.name.slice(0,4)+"</a></h4></div>";
};
if(isFunction(_6e6)){
_6e6();
}
initFile=tempFun;
});
}
function tempFun(_6ea){
if(isFunction(_6ea)){
_6ea();
}
}
})();
XN.dom.readyDo(function(){
commentPost.showLoading=function(){
this.buildLoading();
this.loading&&this.loading.show();
this.isLoading=true;
};
var _id=XN.string.getQuery("id")||XN.profile_owner;
if($("comment")&&$("comment").style.display!="none"){
commentPost.fetchComment({url:"http://gossip."+XN.env.domain+"/ajaxgossiplist.do?ran="+Math.random(),userId:_id});
}
var _6ec=XN.dom.getElementsByClassName("tabs","comWall")[0];
if(!_6ec){
return;
}
var tabs=_6ec.getElementsByTagName("li");
tabs[0].onclick=function(){
$(tabs[0]).addClass("c");
$(tabs[0]).addClass("selected");
$(tabs[1]).delClass("c");
$(tabs[1]).delClass("selected");
$("miniFeed").show();
$("comment").hide();
return false;
};
function tab1Click(){
commentPost.fetchComment({url:"http://gossip."+XN.env.domain+"/ajaxgossiplist.do?ran="+Math.random(),userId:_id});
$(tabs[1]).addClass("c");
$(tabs[1]).addClass("selected");
$(tabs[0]).delClass("c");
$(tabs[0]).delClass("selected");
$("miniFeed").hide();
$("comment").show();
return false;
}
tabs[1].onclick=function(){
return tab1Click();
};
commentPost.idLoadingWrap="talk";
var ncs=Sizzle("#comment .nocomments");
commentPost.addEvent("gossip_send_success",function(){
if(ncs.length>0){
ncs[0].style.display="none";
}
if($(tabs[1]).hasClassName("c")){
return;
}
tabs[1].onclick();
});
commentPost.addEvent("before_fetch_comment",function(){
$(commentPost.idLoadingWrap).innerHTML="";
});
commentPost.addEvent("comments_got",function(){
if(ncs.length>0){
ncs[0].style.display="none";
}
});
commentPost.addEvent("noComments",function(){
if(ncs.length>0){
ncs[0].style.display="";
}else{
commentPost.showNone("TA\u7684\u7559\u8a00\u677f\u6682\u65f6\u8fd8\u6ca1\u6709\u5185\u5bb9,\u8d76\u5feb\u7559\u8a00\u62a2\u5360\u6c99\u53d1\uff01");
}
});
if($("gossipLink")){
$("gossipLink").addEvent("click",function(){
tabs[1].onclick();
if(XN.browser.WebKit){
window.location.href="#gossipBoard";
}
});
}
if($("gossipBoard")){
var _6ef=$("gossipBoard");
var _6f0=$("comment");
$(Sizzle("#gossipBoard .box-header .title")[0]).addEvent("click",function(){
tabs[1].onclick();
});
}
});
function acceptFriend(e,id,name,type){
var _6f5=XN.DO.confirm({title:"\u63a5\u53d7\u597d\u53cb\u8bf7\u6c42",msg:"<center><img src=\""+XN.ENV.staticRoot+"img/indicator.gif\" />\u52a0\u8f7d\u4e2d...</center>",callBack:function(r){
if(r){
var _6f7=$("popFriendGroups").getElementsByTagName("input");
var _6f8={action:"addmultgroups",buddys:id,names:[]};
for(var i=0;i<_6f7.length;i++){
if(_6f7[i].checked){
_6f8.names.push(_6f7[i].value);
}
}
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/ApplyGuestRequest.do",data:"friendId="+id+"&post="+encodeURIComponent(XN.JSON.build(_6f8)),onSuccess:function(r){
var _6fb=XN.JSON.parse(r.responseText);
if(_6fb.ret==5){
_6f5=new XN.ui.dialog({title:"\u65e0\u6cd5\u6dfb\u52a0\u597d\u53cb",message:["<p>\u4f60\u7684\u597d\u53cb\u6570\u5df2\u5230\u4e0a\u9650\uff0c\u53ef\u4ee5\u901a\u8fc7<a style=\"font-weight:bold;\" href=\"http://i.renren.com\" target=\"_blank\">VIP</a>\u670d\u52a1\u63d0\u9ad8\u597d\u53cb\u6570\u4e0a\u9650\uff0c\u6216\u8005\u5220\u9664\u90e8\u5206\u597d\u53cb\u540e\u91cd\u8bd5\u3002</p>"].join(""),showCloseButton:true});
_6f5.footer.hide();
return;
}else{
if(_6fb.ret==4){
var ta=(_6fb.ta=="\u5973\u751f")?"\u5979":"\u4ed6";
_6f5=new XN.ui.dialog({title:"\u65e0\u6cd5\u6dfb\u52a0"+_6fb.applicantName+"\u4e3a\u597d\u53cb",message:["<p><a style=\"font-weight:bold;\" href=\"http://www.renren.com/profile.do?id="+_6fb.applicantId+"\"  target=\"_blank\">"+_6fb.applicantName+"</a>\u597d\u53cb\u6570\u5df2\u5230\u4e0a\u9650\uff0c\u53ef\u4ee5\u9001"+ta+"<a style=\"font-weight:bold;\" href=\"http://i.renren.com\" target=\"_blank\">VIP</a>\u63d0\u9ad8"+ta+"\u7684\u597d\u53cb\u6570\u4e0a\u9650\u3002</p>"].join(""),showCloseButton:true});
_6f5.footer.hide();
return;
}
}
$("friendRequest").remove();
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u901a\u4fe1\u5931\u8d25,\u8bf7\u91cd\u8bd5");
}});
}
}});
_6f5.footer.hide();
fillGroup(id,_6f5);
}
function rejectFriend(e,id,name,type){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/rejguereq.do",data:"id="+id,onSuccess:function(r){
$("friendRequest").remove();
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u901a\u4fe1\u5931\u8d25,\u8bf7\u91cd\u8bd5");
}});
}
function fillGroup(id,_703){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/showfriendgroup.do",data:"friendId="+id,onSuccess:function(r){
_703.body.setContent(r.responseText);
},onError:function(){
_703.hide();
XN.DO.showError("\u7f51\u7edc\u901a\u4fe1\u5931\u8d25,\u8bf7\u91cd\u8bd5");
},onComplete:function(){
if(_703!=null){
_703.footer.show();
}
}});
}
function adjustOffset(type){
if(typeof ($(type+"_variableOffset"))!="undefined"){
var _706=$(type+"_variableOffset").value;
_706=_706-1;
if(_706<0){
_706=0;
}
$(type+"_variableOffset").value=_706;
}
}
function checkGroupName(name){
if(name==""||name=="\u65b0\u5efa\u5206\u7ec4"){
alert("\u5206\u7ec4\u540d\u4e0d\u80fd\u4e3a\u7a7a");
return false;
}
if(name.length>10){
alert("\u5206\u7ec4\u540d\u4e0d\u80fd\u8d85\u8fc710\u4e2a\u5b57\u7b26");
return false;
}
if(!/^[0-9a-z\u4e00-\u9fa5]*$/i.test(name)){
alert("\u53ea\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u5b57\u7b26\u3001\u6570\u5b57\u548c\u4e2d\u6587\uff01");
return false;
}
return true;
}
function popEditGroupName(node){
var _709=XN.STRING.trim(node.innerHTML);
function getEditInput(){
var _70a=$element("input");
_70a.className="input-text";
_70a.onblur=update;
_70a.value=_709;
return _70a;
}
function update(){
var _70b=this;
var name=XN.STRING.trim(_70b.value);
$(_70b).remove();
node.style.display="inline-block";
if(name!=_709&&checkGroupName(name)){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/editGroup.do",data:"post="+encodeURIComponent(XN.JSON.build({action:"rename",name:name,oldname:_709})),onSuccess:function(r){
if(XN.STRING.strip(r.responseText).charAt(0)=="0"){
var _70e=node.parentNode;
_70e.getElementsByTagName("input")[0].value=name;
_70e.getElementsByTagName("label")[0].innerHTML=name;
_70e.getElementsByTagName("a")[0].onclick=function(){
popDelGroupName(name,_70e.id.substring(_70e.id.indexOf("_")+1));
};
}else{
alert("\u91cd\u547d\u540d\u5206\u7ec4\u5931\u8d25");
}
},onError:function(){
alert("\u91cd\u547d\u540d\u5206\u7ec4\u5931\u8d25");
}});
}
}
var _70f=getEditInput();
var _710=node.parentNode;
_710.insertBefore(_70f,node);
node.style.display="none";
_70f.focus();
return false;
}
function cancelNewGroup(){
var _711=$("popNewGroup");
_711.innerHTML="<a onclick=\"popNewFriendGroup()\" href=\"#nogo\">+\u521b\u5efa\u65b0\u5206\u7ec4</a>";
}
function popNewFriendGroup(){
var _712=$("popNewGroup");
_712.innerHTML="<input id=\"newGroupName\" class=\"input-text\" style=\"width:120px;\"/>\u3000<a href=\"#nogo\" onclick=\"popCreateNewGroup()\">\u521b\u5efa\u5206\u7ec4</a>\u3000<a href=\"#nogo\" onclick=\"cancelNewGroup()\">\u53d6\u6d88\u521b\u5efa</a>";
$("newGroupName").focus();
}
function popDelGroupName(name,_714){
if(confirm("\u60a8\u771f\u7684\u8981\u5220\u9664\u5206\u7ec4:\""+name+"\"?\n\u63d0\u793a: \u5220\u9664\u5206\u7ec4\u64cd\u4f5c\uff0c\u5e76\u4e0d\u4f1a\u5220\u9664\u8be5\u5206\u7ec4\u4e0b\u7684\u597d\u53cb\uff01")){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/editGroup.do",data:"post="+encodeURIComponent(XN.JSON.build({action:"delete",name:XN.STRING.trim(name)})),onSuccess:function(r){
if(XN.STRING.trim(r.responseText).charAt(0)=="0"){
$("groupLi_"+_714).remove();
}else{
alert("\u5220\u9664\u5206\u7ec4\u5931\u8d25");
}
},onError:function(){
alert("\u5220\u9664\u5206\u7ec4\u5931\u8d25");
}});
}
}
function popCreateNewGroup(){
var name=XN.STRING.trim($("newGroupName").value);
if(checkGroupName(name)){
new XN.NET.xmlhttp({url:"http://friend."+XN.env.domain+"/editGroup.do",data:"post="+encodeURIComponent(XN.JSON.build({action:"create",name:XN.STRING.trim(name)})),onSuccess:function(r){
if(XN.STRING.strip(r.responseText).charAt(0)=="0"){
var _718=$("popFriendGroups").getElementsByTagName("li").length;
var li=$element("li");
li.id="groupLi_"+_718;
li.innerHTML="<input name=\"group\" id=\"groupCheck_"+_718+"\" type=\"checkbox\" class=\"checkbox\" value=\""+name+"\"/>"+"<label onclick=\"return popEditGroupName(this)\" id=\"groupName_"+_718+"\" for=\"groupCheck_"+_718+"\">"+name+"</label> "+"<a class=\"x-2-hide\" onclick=\"popDelGroupName('"+name+"','"+_718+"')\" href=\"javascript:void(0);\">\xd7</a>";
$("popFriendGroups").appendChild(li);
}else{
XN.DO.showError("\u521b\u5efa\u597d\u53cb\u5206\u7ec4\u5931\u8d25<br />"+msg);
}
},onError:function(){
XN.DO.showError("\u521b\u5efa\u597d\u53cb\u5206\u7ec4\u5931\u8d25<br />"+msg);
},onComplete:function(){
if($("noGroupTip")){
$("noGroupTip").remove();
}
cancelNewGroup();
}});
}
}
function copyPersonalUrl(url,_71b,name){
var str=url;
if(_71b){
var text="\u6211\u7684\u4eba\u4eba\u7f51\u4e3b\u9875\uff0c\u5e38\u6765\u770b\u770b\u5427\uff1a";
}else{
var text=name+"\u7684\u4eba\u4eba\u7f51\u4e3b\u9875\u633a\u6709\u610f\u601d\uff0c\u770b\u770b\u5427\uff1a";
}
if(window.clipboardData&&clipboardData.setData){
if(clipboardData.setData("text",text+str)){
XN.DO.confirm({message:"<div class=\"clearfix\"><div class=\"float-left\" style=\"background:url(http://a.xnimg.cn/imgpro/share/share-success.gif) center 20px no-repeat;width:90px;height:100px;border-right:1px solid #E3EEF8\"><p style=\"padding:60px 0 0 20px;\">\u590d\u5236\u6210\u529f\uff01</p></div><div class=\"float-left\" style=\"padding:18px 0 0 18px\"><p style=\"margin-bottom:8px;font-size:14px!important;font-weight:bold;\">\u4e3b\u9875\u5730\u5740\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f\u4e2d\uff0c</p><p style=\"margin-bottom:8px;font-size:14px!important;font-weight:bold;\">\u5feb\u7c98\u5e16\u5230QQ\u7fa4\u3001\u8d34\u5427\u91cc\u63a8\u8350\u7ed9\u597d\u53cb\u5427\uff01</p><p style=\"color:#888;\"><span id=\"copySuccessCloseTime\">3</span>\u79d2\u540e\u81ea\u52a8\u5173\u95ed</p></div></div>",showCloseButton:true}).setWidth(430).autoHide(3).footer.hide();
return true;
}
}else{
XN.DO.confirm({message:"<div style=\"background:url(http://a.xnimg.cn/imgpro/icons/error.png) 10px 10px no-repeat;padding-left:80px\">"+"<div style=\"padding-top:20px\">"+"<p style=\"margin-bottom:8px;font-weight:bold;font-size:14px!important;\">\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u81ea\u52a8\u590d\u5236\uff0c\u8bf7\u624b\u52a8\u590d\u5236\u4ee5\u4e0b\u94fe\u63a5\uff1a</p>"+"<p>\u7c98\u5e16\u5230QQ\u7fa4\u3001\u8d34\u5427\u7b49\u548c\u5927\u5bb6\u5206\u4eab\u5427\uff01</p>"+"<div style=\"margin-top:8px;border:1px solid #A0BEDC;color:#666;padding:10px;\">"+"<p style=\"margin-bottom:5px\">"+text+"</p>"+"<p>"+str+"</p>"+"</div>"+"</div>"+"</div>",showCloseButton:true}).setWidth(480).footer.hide();
return false;
}
XN.DO.confirm({message:"<div style=\"background:url(http://a.xnimg.cn/imgpro/icons/error.png) 10px 10px no-repeat;padding-left:80px\">"+"<div style=\"padding-top:20px\">"+"<p style=\"margin-bottom:8px;font-weight:bold;font-size:14px!important;\">\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u81ea\u52a8\u590d\u5236\uff0c\u8bf7\u624b\u52a8\u590d\u5236\u4ee5\u4e0b\u94fe\u63a5\uff1a</p>"+"<p>\u7c98\u5e16\u5230QQ\u7fa4\u3001\u8d34\u5427\u7b49\u548c\u5927\u5bb6\u5206\u4eab\u5427\uff01</p>"+"<div style=\"margin-top:8px;border:1px solid #A0BEDC;color:#666;padding:10px;\">"+"<p style=\"margin-bottom:5px\">"+text+"</p>"+"<p>"+str+"</p>"+"</div>"+"</div>"+"</div>",showCloseButton:true}).setWidth(480).footer.hide();
return false;
}
function showPersonalUrlTip(){
return;
if($("personalUrlTip")){
var tip=$("personalUrlTip");
var _720=tip.offsetHeight;
tip.style.cssText="top:-"+(_720+3)+"px;visibility:visible;";
}
}
window.showStatusPosition=function(_721,_722,_723,ele){
if(XN.webpager&&!XN.webpager.forLbsClick){
$("webpager").addEvent("click",function(){
if($("statusLocationInfo")){
$("statusLocationInfo").hide();
}
});
XN.webpager.forLbsClick=1;
}
if(!ele["lbsClicked"]){
$(ele).addEvent("click",function(_725){
XN.event.stop(_725);
ele["lbsClicked"]=true;
});
}
if(!$("statusLocationInfo")){
var _726=$element("div");
_726.id="statusLocationInfo";
_726.addEvent("click",function(_727){
if(XN.event.element(_727).tagName.toLowerCase()!="a"){
XN.event.stop(_727);
}
});
_726.style.cssText="position:absolute;top:-9999px;left:-9999px;";
$("dropmenuHolder").appendChild(_726);
}
if(window.currentStatusPositionBtn&&window.currentStatusPositionBtn==ele&&$("statusLocationInfo").style.display=="block"){
$("statusLocationInfo").style.display="none";
return;
}
window.currentStatusPositionBtn=ele;
var pid=_721,uid=_722,ft=_723,btn=$(ele);
if(window.locationRequest){
window.locationRequest.abort();
}
window.locationRequest=new XN.NET.xmlhttp({url:"http://places.renren.com/web/getWebFeedInfo?id="+pid+"&userId="+uid+"&feedType="+ft,method:"get",onSuccess:function(_72c){
var r=XN.JSON.parse(_72c.responseText);
var _72e=r.address.name,url=r.address.linkUrl,img=r.address.previewMap;
var _731=new Image();
_731.src=img;
if(_72e.length>=14){
_72e=_72e.slice(0,13)+"...";
}
var html=["<div style=\"padding:4px;border:1px solid #CEE1EE;background:#F0F5F8;width:235px;\">","<div class=\"clearfix\" style=\"margin-bottom:4px;\">",((url=="")?(""):("<a href=\""+url+"\" style=\"float:right\" target=\"_blank\">\u8be6\u60c5&raquo;</a>")),"<span style=\"color:#666\" title=\"",_72e,"\">",_72e,"</span>","</div>","<div style=\"width:235px;height:130px;overflow:hidden;\"><img src=\"",img,"\" /></div>","</div>","<div style=\"width:11px;height:6px;overflow:hidden;background:url(http://a.xnimg.cn/imgpro/arrow/arrow-down-lbs.png) 0 0 no-repeat;margin-top:-1px;margin-left:115px;\"></div>"].join("");
$("statusLocationInfo").innerHTML=html;
var pop=new XN.ui.fixPositionElement({id:"statusLocationInfo",alignWith:btn,alignType:"1-4",offsetX:-97});
if(!pop._isShow){
pop.show();
}
}});
};
$(document).addEvent("click",function(){
if($("statusLocationInfo")){
$("statusLocationInfo").hide();
}
});
function mcFeedLike(_734){
XN.loadFile("http://s.xnimg.cn/jspro/music/music.for.feed.js",function(){
sandBox.music.like(_734);
});
}
function mcFeedFav(_735,type){
XN.loadFile("http://s.xnimg.cn/jspro/music/music.for.feed.js",function(){
if(type=="134"){
sandBox.music.favAlbum(_735);
}else{
sandBox.music.fav(_735);
}
});
}
window.playswf=function(el,file,_739){
var w,h;
el=$(el+"");
w=el.parentNode.offsetWidth-24;
if(w>450){
w=450;
}
h=parseInt(w/_739);
el.innerHTML=XN.Template.flash({width:w,height:h,filename:file});
el.onclick=null;
};
XN.page.profile.gallery={photos:[],container:null,ul:null,footer:null,uid:"",purl:"",step:5,begin:0,realBegin:0,admin:false,init:function(box,adm,id){
if(!box||(typeof (photoModuleJson)).toLowerCase()=="undefined"){
return;
}
this.photos=photoModuleJson;
this.begin=0;
this.realBegin=0;
this.purl="http://photo.renren.com/getalbumlist.do?id="+id;
if(adm){
this.admin=true;
this.purl="http://photo.renren.com/photo/"+id;
}
if(!this.admin&&(this.photos.length==0||!this.photos)){
return;
}
this.uid=id;
this.container=box;
if(!$("latestPhotosTip")){
var div=$element("div");
div.id="latestPhotosTip";
div.style.cssText="position:absolute;top:-9999px;left:-9999px;width:100px;";
div.innerHTML="<div class=\"tip-content\" style=\"text-align:center;border:1px solid #83ACC6;padding:5px;background:#F0F5F8;line-height:normal;\"></div><div style=\"background:url(http://a.xnimg.cn/imgpro/arrow/tip-arrow-up-b.png) 0 0 no-repeat;width:11px;height:6px;overflow:hidden;position:absolute;top:-5px;left:45px;\"></div>";
document.body.appendChild(div);
}
this.buildContainer();
this.ul=$("latest-photos-list");
this.footer=Sizzle(".footer",this.container)[0];
this.append();
},ui_loading:function(){
this.footer.innerHTML="<span class=\"loading\" style=\"color:#666666\"><img src=\"http://a.xnimg.cn/n/core/res/loading.gif\" /></span>";
},ui_hasMore:function(){
this.footer.innerHTML="<span class=\"hasmore\" style=\"position:relative;\"><a stats=\"pf_morealbum\" class=\"more\" href=\"javascript:;\" onclick=\"XN.page.profile.gallery.append();\">\u67e5\u770b\u66f4\u591a <img src=\"http://a.xnimg.cn/imgpro/arrow/feed_filter_dropmini.gif\" /></a><a style=\"display:none;position:absolute;bottom:0;*bottom:-2px;right:10px;\" href=\"javascript:;\" class=\"folder\" onclick=\"XN.page.profile.gallery.hideFolderBtn();\" stats=\"pf_lessalbum\">\u6536\u8d77</a></span>";
},ui_noMore:function(){
this.footer.innerHTML="<span class=\"nomore\" style=\"color:#666666;position:relative;\">\u8fd8\u60f3\u770b\u66f4\u591a\uff1f<a style=\"float:none\" href=\""+this.purl+"\" stats=\"pf_allalbum2\">\u67e5\u770b\u5168\u90e8\u76f8\u518c</a><a style=\""+((this.photos.length<=this.step)?"display:none;":"")+"position:absolute;bottom:0;*bottom:-2px;right:10px;\" href=\"javascript:;\" class=\"folder\" onclick=\"XN.page.profile.gallery.hideFolderBtn();\" stats=\"pf_lessalbum\">\u6536\u8d77</a></span>";
},ui_none:function(){
this.footer.innerHTML="";
this.footer.style.display="none";
},ui_showFolder:function(){
var btn=Sizzle(".folder",this.footer)[0];
if(!btn){
return;
}
btn.style.display="";
},ui_hideFolder:function(){
var btn=Sizzle(".folder",this.footer)[0];
if(!btn){
return;
}
btn.style.display="none";
},_append:function(){
if(this.admin&&(this.photos.length==0||!this.photos)){
for(var k=0;k<5;k++){
this.ul.appendChild(this.replenish(k));
}
return;
}
this.ui_loading();
if(this.begin==0){
var _743=this.step;
}else{
var _743=this.step*2;
}
for(var i=this.begin;i<(_743+this.begin)&&i<this.photos.length;i++){
this.ul.appendChild(this.buildItem(this.photos[i],i));
this.realBegin++;
}
this.begin+=_743;
if(this.begin<=this.photos.length){
this.ui_hasMore();
}else{
if(this.photos.length>this.step){
this.ui_noMore();
}else{
this.ui_none();
}
}
if(this.photos.length<this.step){
this.ui_none();
for(var j=0;j<(this.step-this.photos.length);j++){
this.ul.appendChild(this.replenish(j));
}
}
if(this.begin>=25){
this.ui_noMore();
}
if(this.photos.length<=5){
this.ui_none();
}
if(XN.browser.IE6){
if(this.ul.style.height=="auto"){
return;
}
this.ul.style.height="auto";
return;
}
this.animation();
},_checkExist:function(id,_747){
for(var i=0;i<_747.length;i++){
if(parseInt(_747[i].id)==parseInt(id)){
return true;
}
}
return false;
},append:function(){
if(this.begin>0&&this.begin<25){
var that=this;
this.ui_loading();
new XN.net.xmlhttp({url:"http://www.renren.com/pagpm?oi="+this.uid+"&po="+this.begin+"&pl=10",useCache:true,onSuccess:function(r){
var nps=XN.json.parse(r.responseText);
for(var i=0;i<nps.length;i++){
if(that._checkExist(nps[i].id,that.photos)){
continue;
}
that.photos.push(nps[i]);
}
that._append();
if(nps.length>0){
that.ui_showFolder();
}
}});
}else{
this._append();
}
},hideFolderBtn:function(){
var btn=Sizzle(".folder",this.footer)[0];
if(!btn){
return;
}
if(btn.style.display!="none"){
btn.style.display="none";
this.begin=0;
this.realBegin=0;
this.animationBack();
}
if(this.photos.length>=this.step){
this.ui_hasMore();
}
},buildContainer:function(){
var html="<div class=\"latest-photos\">"+"<div class=\"header\">"+"<div class=\"options\">"+((this.admin&&this.photos.length>=this.step)?"<a class=\"flashUploader\" stats=\"pf_newalbum\" href=\"http://upload.renren.com/addphoto.do\">\u4e0a\u4f20\u65b0\u7167\u7247</a><span class=\"pipe\">|</span>":"")+"<a stats=\"pf_allalbum\" href=\""+this.purl+"\">\u5168\u90e8\u76f8\u518c</a>"+"</div>"+"<h4>\u6700\u65b0\u7167\u7247</h4>"+"</div>"+"<div class=\"content\">"+"<ul id=\"latest-photos-list\" style=\"margin-right:-10px;height:73px;\"></ul>"+"</div>"+"<div class=\"footer\"></div>"+"</div>";
this.container.innerHTML=html;
},buildItem:function(o,i){
var aid=o.aid,id=o.id,img=o.headUrl,_754=o.title,_755=(o.fullDisplayTitle.length>50)?(o.fullDisplayTitle.substring(0,50)+"..."):o.fullDisplayTitle,_756=o.viewCount,_757=o.commentCount;
var li=$element("li");
var _759=(_757>0)?("<a title=\""+_757+"\u6761\u8bc4\u8bba\" class=\"comments\" href=\"http://photo.renren.com/photo/"+this.uid+"/photo-"+id+"\"></a>"):"";
li.innerHTML="<a stats=\"pf_album\" href=\"http://photo.renren.com/photo/"+this.uid+"/photo-"+id+"\" class=\"photo\" style=\"background-image:url("+img+")\"></a>"+_759;
li.data_desc=_755;
var that=this;
if(li.data_desc!=""){
$(Sizzle(".photo",li)[0]).addEvent("mouseover",function(){
that.showTip(li);
}).addEvent("mouseout",function(){
that.hideTip(li);
});
}
return li;
},showTip:function(li){
Sizzle("#latestPhotosTip .tip-content")[0].innerHTML=li.data_desc;
if(li.descTip){
li.descTip.show();
return;
}
li.descTip=new XN.UI.fixPositionElement({id:"latestPhotosTip",alignWith:li,alignType:"4-1",useIframeInIE6:false});
},hideTip:function(li){
if(li.descTip){
li.descTip.hide();
}
},replenish:function(i){
var li=$element("li");
li.addClass("replenish");
if(i==0&&this.admin){
li.innerHTML="<a class=\"flashUploader\" stats=\"pf_newalbum2\" href=\"http://upload.renren.com/addphoto.do\">\u4e0a\u4f20\u65b0\u7167\u7247</a>";
}
return li;
},animation:function(){
if(this.begin<=5){
return;
}
var h=parseInt(this.ul.style.height);
var that=this;
var _761=new XN.effect.Motion("easeIn",300);
_761.onTweening=function(){
that.ul.style.height=this.equation(h,73*Math.ceil(that.realBegin/that.step))+"px";
};
_761.onComplete=function(){
that.ul.style.height=73*Math.ceil(that.realBegin/that.step)+"px";
};
_761.start();
},animationBack:function(){
if(XN.browser.IE6){
this.ul.innerHTML="";
this.append();
}else{
var h=parseInt(this.ul.style.height);
var that=this;
var _764=new XN.effect.Motion("easeIn",300);
_764.onTweening=function(){
that.ul.style.height=this.equation(h,73)+"px";
};
_764.onComplete=function(){
that.ul.style.height="73px";
that.ul.innerHTML="";
that.append();
};
_764.start();
}
}};
XN.page.profile.loveStatusEditor=function(ele,_766,_767){
this.author="chuanye.wang@foxmail.com";
this.init(ele,_766,_767);
};
XN.page.profile.loveStatusEditor.prototype={editor:null,wraper:null,handler:null,cPanel:"-1",oPanel:"",hideStatus:false,showLover:false,lovers:[],init:function(ele,_769,_76a){
this.handler=ele;
this.cPanel=this.reTypeMap[_769];
this.oPanel=this.reTypeMap[_769];
this.lovers=_76a||[];
this.loverIds=(function(_76b){
var a=[];
for(var i=0;i<_76b.length;i++){
a.push(_76b[i].id);
}
return a;
})(this.lovers);
this.buildWraper(_769);
this.editor=Sizzle(".love-status-editor",this.wraper)[0];
this.bindEvent();
},buildWraper:function(_76e){
var html="<div class=\"love-status-editor\">"+"<div class=\"menubar\">"+"<span class=\"label\"><img src=\"http://a.xnimg.cn/imgpro/icons/heart.png\" /> \u4f60\u73b0\u5728\uff1a</span>"+"<select>"+"<optgroup>"+"<option "+(_76e=="0"?"selected=selected":"")+" value=\"null\">\u8bf7\u9009\u62e9</option>"+"<option "+(_76e=="1"?"selected=selected":"")+" value=\"0\">\u5355\u8eab</option>"+"<option "+(_76e=="5"?"selected=selected":"")+" value=\"1\">\u604b\u7231\u4e2d</option>"+"<option "+(_76e=="7"?"selected=selected":"")+" value=\"2\">\u8ba2\u5a5a</option>"+"<option "+(_76e=="8"?"selected=selected":"")+"  value=\"3\">\u5df2\u5a5a</option>"+"</optgroup>"+"<optgroup style=\"border-top:1px solid #E0E0E0;padding-top:5px;margin-top:5px;\">"+"<option "+(_76e=="4"?"selected=selected":"")+" value=\"0-1\">\u559c\u6b22\u67d0\u4eba\uff08\u5355\u8eab\uff09</option>"+"<option "+(_76e=="3"?"selected=selected":"")+" value=\"0-2\">\u8ffd\u6c42\u67d0\u4eba\uff08\u5355\u8eab\uff09</option>"+"<option "+(_76e=="6"?"selected=selected":"")+" value=\"1-1\">\u51b7\u6218\u4e2d\uff08\u604b\u7231\u4e2d\uff09</option>"+"<option "+(_76e=="9"?"selected=selected":"")+" value=\"3-2\">\u871c\u6708\u4e2d\uff08\u5df2\u5a5a\uff09</option>"+"<option "+(_76e=="2"?"selected=selected":"")+" value=\"0-3\">\u79bb\u5f02\uff08\u5355\u8eab\uff09</option>"+"</optgroup>"+"</select>"+"<span class=\"not-show\">"+"<label style=\"margin:0;\">"+"<input type=\"checkbox\" style=\"margin:0;\" />"+" \u9690\u85cf"+"</label>"+"</span>"+"</div>"+"<div class=\"panel\"></div>"+"</div>";
this.wraper=$element("div");
this.wraper.innerHTML=html;
this.select=Sizzle("select",this.wraper)[0];
this.panel=Sizzle(".panel",this.wraper)[0];
this.switchPanel(this.select.value);
},buildFlist:function(max){
this.flist=Sizzle(".flist",this.panel)[0];
if(!this.flist){
return;
}
var html="";
var l=this.lovers.length,r=max-this.lovers.length;
var _774=l<1;
for(var i=0;i<l;i++){
html+="<div class=\"one-lover\">"+"<div class=\"clearfix\" style=\"width:165px;float:left;\">"+"<a class=\"avatar\" href=\"http://www.renren.com/profile.do?id="+this.lovers[i].id+"\">"+"<img src=\""+(this.lovers[i].tinyUrl||this.lovers[i].head)+"\" width=\"30\" height=\"30\" />"+"</a>"+"<span class=\"name\">"+this.lovers[i].name+"</span>"+"<a href=\"#nogo\" data-index=\""+i+"\" onclick=\"return false;\" class=\"x-to-hide\"></a>"+"</div>"+"<div class=\"clearfix\" style=\"float:left;\">"+((i==l-1&&r>0)?("<a href=\"#nogo\" onclick=\"return false;\" class=\"add\">\u6dfb\u52a0</a><span class=\"desc\">\u8fd8\u53ef\u4ee5\u6dfb\u52a0"+r+"\u4f4d</span>"):"")+"</div>"+"</div>";
}
html+="<div class=\"one-lover add-lover\""+(_774?"":" style=\"display:none;\"")+">"+"<img class=\"avatar\" src=\"http://a.xnimg.cn/imgpro/avatar/d_default_50.gif\" width=\"30\" height=\"30\" />"+"<input class=\"input-text\" type=\"text\" />";
"</div>";
this.flist.innerHTML=html;
if(Sizzle(".input-text",this.flist)[0]){
var This=this;
this.initFriendsSelector();
this.fs.addEvent("select",function(r){
if(This.loverIds.indexOf(r.id)!=-1){
XN.DO.showError("<span style=\"font-size:14px;\">\u5df2\u7ecf\u6dfb\u52a0\u8fc7"+r.name+"\u4e86</span>");
return;
}
This.lovers.push({id:r.id,head:r.head,name:r.name});
This.loverIds.push(r.id);
This.buildFlist(This.max);
});
}
},panels:{"null":"<div class=\"description\">\u8bf7\u6dfb\u52a0\u9002\u5408\u4f60\u7684\u611f\u60c5\u72b6\u6001\u63cf\u8ff0</div>","0":"<p style=\"padding-left:15px;padding-top:10px;\">\u6709\u559c\u6b22\u7684\u4eba\uff1f\u53ef\u4ee5\u8bd5\u8bd5\u4e0b\u9762</p><div class=\"plist clearfix\"><span class=\"label\">\u4f60\u559c\u6b22\uff1a</span><div class=\"flist\"></div></div><div class=\"description\">\u559c\u6b22\u8c01\u662f\u4fdd\u5bc6\u7684\uff0c\u5982\u679c\u5f7c\u6b64\u559c\u6b22\uff0c\u4f60\u4eec\u4f1a\u6536\u5230\u901a\u77e5</div>","1":"<div class=\"plist clearfix\"><span class=\"label\">\u4f60\u559c\u6b22\uff1a</span><div class=\"flist\"></div></div><div class=\"show-love-name\"><label style=\"margin:0;\"><input type=\"checkbox\" style=\"margin:0;\"/> \u516c\u5f00\u604b\u4eba\u59d3\u540d</label></div><div class=\"description\">\u5bf9\u65b9\u4f1a\u6536\u5230\u4e00\u6761\u8bf7\u6c42\uff0c\u786e\u8ba4\u540e\u611f\u60c5\u5173\u7cfb\u4fee\u6539\u6210\u529f<a href=\"#nogo\" style=\"margin-left:20px;\">\u5f00\u901a\u60c5\u4fa3\u7a7a\u95f4</a></div>","2":"<div class=\"plist clearfix\"><span class=\"label\">\u4f60\u559c\u6b22\uff1a</span><div class=\"flist\"></div></div><div class=\"show-love-name\"><label style=\"margin:0;\"><input type=\"checkbox\" style=\"margin:0;\"/> \u516c\u5f00\u7231\u4eba\u59d3\u540d</label></div><div class=\"description\">\u5bf9\u65b9\u4f1a\u6536\u5230\u4e00\u6761\u8bf7\u6c42\uff0c\u786e\u8ba4\u540e\u611f\u60c5\u5173\u7cfb\u4fee\u6539\u6210\u529f<a href=\"#nogo\" style=\"margin-left:20px;\">\u5f00\u901a\u60c5\u4fa3\u7a7a\u95f4</a></div>","3":"<div class=\"plist clearfix\"><span class=\"label\">\u4f60\u559c\u6b22\uff1a</span><div class=\"flist\"></div></div><div class=\"show-love-name\"><label style=\"margin:0;\"><input type=\"checkbox\" style=\"margin:0;\"/> \u516c\u5f00\u7231\u4eba\u59d3\u540d</label></div><div class=\"description\">\u5bf9\u65b9\u4f1a\u6536\u5230\u4e00\u6761\u8bf7\u6c42\uff0c\u786e\u8ba4\u540e\u611f\u60c5\u5173\u7cfb\u4fee\u6539\u6210\u529f<a href=\"#nogo\" style=\"margin-left:20px;\">\u5f00\u901a\u60c5\u4fa3\u7a7a\u95f4</a></div>"},initFriendsSelector:function(){
var _778=["<div class=\"m-autosug lovers-list\">","<div class=\"m-autosug-minwidth\">","<div class=\"m-autosug-content\">","<ul></ul>","</div>","</div>","</div>"].join("");
this.fs=new XN.ui.friendSelector({id:Sizzle(".input-text",this.flist)[0],autoSelectFirst:true,wrapper:_778});
this.fs.buildMenu=function(r){
return "<img src=\""+r.head+"\" width=\"30\" height=\"30\" alt=\""+r.name+"\"/>"+"<strong style=\"white-space:nowrap\">"+r.name+"</strong>";
};
this.fs.menu.setWidth(173);
},switchPanel:function(type){
var t=type.split("-")[0];
this.panel.innerHTML=this.panels[t];
this.oPanel=this.cPanel;
this.cPanel=type;
if(this.oPanel.split("-")[0]!=t){
this.lovers=[];
this.loverIds=[];
}
this.max=5;
if(t=="1"||t=="2"||t=="3"){
this.max=1;
}
this.buildFlist(this.max);
if(!this.flist){
return;
}
var This=this;
XN.event.addEvent(this.flist,"click",function(e){
var ele=XN.event.element(e);
if(ele.className=="x-to-hide"){
var indx=parseInt(ele.getAttribute("data-index"));
This.lovers.splice(indx,1);
This.loverIds.splice(indx,1);
This.buildFlist(This.max);
}
if(ele.className=="add"){
Sizzle(".add-lover",This.panel)[0].style.display="block";
Sizzle(".add-lover .input-text",This.panel)[0].focus();
}
});
},typeMap:{"null":{code:"0",desc:"\u6dfb\u52a0\u611f\u60c5\u72b6\u6001"},"0":{code:"1",desc:"\u73b0\u5728\u5355\u8eab"},"0-3":{code:"2",desc:"\u73b0\u5728\u79bb\u5f02\u4e86"},"0-2":{code:"3",desc:"\u73b0\u5728\u5355\u8eab\uff0c\u6b63\u8ffd\u6c42\u67d0\u4eba"},"0-1":{code:"4",desc:"\u73b0\u5728\u5355\u8eab\uff0c\u4f46\u559c\u6b22\u67d0\u4eba"},"1":{code:"5",desc:"\u73b0\u5728\u604b\u7231\u4e2d"},"1-1":{code:"6",desc:"\u604b\u7231\u4e2d\uff0c\u4f46\u6b63\u5728\u51b7\u6218"},"2":{code:"7",desc:"\u73b0\u5728\u8ba2\u5a5a\u4e86"},"3":{code:"8",desc:"\u73b0\u5728\u7ed3\u5a5a\u4e86"},"3-2":{code:"9",desc:"\u5df2\u5a5a\uff0c\u6b63\u5728\u871c\u6708\u4e2d"}},reTypeMap:{"0":"null","1":"0","2":"0-3","3":"0-2","4":"0-1","5":"1","6":"1-1","7":"2","8":"3","9":"3-2"},save:function(){
var This=this;
var ids=this.loverIds.join(",");
new XN.net.xmlhttp({url:"http://www.renren.com/updateEmotion/update",data:"type="+this.typeMap[this.cPanel].code+"&ids="+this.loverIds.join(","),onSuccess:function(r){
if(r.responseText!=0){
XN.DO.showError("\u4fee\u6539\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5");
}else{
XN.user.lovers=This.lovers;
This.handler.parentNode.innerHTML=This.typeMap[This.cPanel].desc+" <a class=\"edit-love-status\" onclick=\"editLoveStatus(this,'"+This.typeMap[This.cPanel].code+"',XN.user.lovers);return false;\" href=\"#nogo\">\u7f16\u8f91</a>";
}
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5");
}});
},bindEvent:function(){
var _783=function(a,b,c){
if(!a){
return;
}
XN.event.addEvent(a,b,c);
};
var This=this;
_783(this.select,"change",function(){
This.switchPanel(This.select.value);
});
}};
var editLoveStatus=function(ele,_789,_78a){
var _78b=new XN.page.profile.loveStatusEditor(ele,_789,_78a);
XN.page.profile.loveStatusEditor.pop=XN.DO.confirm({title:"\u611f\u60c5\u72b6\u6001",message:_78b.editor,submit:"\u4fdd\u5b58",showCloseButton:true,width:420,callback:function(r){
if(r){
_78b.save();
}
}});
};
var popPage=function(_78d){
if(XN.env.domain=="kaixin.com"){
return;
}
this.config={};
$extend(this.config,{reqUrl:"http://page."+XN.env.domain+"/community/ajaxQuery",mark:".pop-module-mark",createUrl:"http://page."+XN.env.domain+"/register/regGuide",homeUrl:"http://page."+XN.env.domain,loaderrMsg:"\u52a0\u8f7d\u5931\u8d25\uff01"});
$extend(this.config,_78d);
this.init();
};
popPage.prototype={init:function(){
var This=this;
this.popElement=null;
this.outOfMarkTime=0;
this.outOfBoxTimer=null;
this.bindEvents();
},bindEvents:function(){
var This=this;
jQuery(this.config.mark).live("mouseover",function(){
This.clearTimer();
if(This.outOfBoxTime&&(new Date().getTime()-This.outOfBoxTime)<=500&&This.rdId==jQuery(this).attr("rdId")){
return;
}
var obj=jQuery(this);
This.href=obj.attr("href");
This.rdId=Math.random()+"";
obj.attr("rdId",This.rdId);
var pos=obj.offset();
This.ajaxGetPages(this,pos.top+15,pos.left);
}).live("mouseout",function(){
This.outOfMarkTime=new Date().getTime();
This.outOfBoxTimer=setTimeout(function(){
jQuery("#recBox").hide();
},500);
});
},getQueryString:function(ele){
var k=XN.json.parse(jQuery(ele).attr("k"));
return "key="+encodeURI(k.key)+"&type="+k.type;
},ajaxGetPages:function(ele,t,l){
var This=this;
var k=XN.json.parse(jQuery(ele).attr("k"));
if(k&&(k.type==3)&&(k.key!="70"&&k.key!="80"&&k.key!="90")){
this.popElement&&this.popElement.hide();
return;
}
This.initPopElement(k,t,l);
new XN.net.xmlhttp({url:This.config.reqUrl+"?"+This.getQueryString(ele),data:This.getQueryString(ele),method:"GET",onSuccess:function(r){
jQuery("#pageloading").hide();
try{
var ret=XN.json.parse(r.responseText);
This.updatePage(k.showPages,ret);
}
catch(e){
}
},onError:function(){
This.loadErr();
}});
},loadErr:function(){
jQuery("#pageTitle").html("");
jQuery("#pageloading").hide();
jQuery("#pageMutiData").parent().parent().hide();
jQuery("#pageSingleData").parent().hide();
jQuery("#nopage").hide();
jQuery("#loadingErr").show();
},initPopElement:function(k,t,l){
var html="";
html="<div class=\"arrow-top\"></div><div class=\"content single\"  style=\"display:none\"><div class=\"clearfix\" id=\"pageSingleData\"></div></div>"+"<div class=\"content multiple\" style=\"display:none\"><h3 id=\"pageTitle\">"+(k.title?k.title:"")+"</h3><div class=\"clearfix\"><ul class=\"page-pop-list clearfix\" id=\"pageMutiData\"></ul></div></div>"+"<div class=\"content loading\" id=\"pageloading\"><img src=\"http://a.xnimg.cn/imgpro/bg/loading.gif\"><span>\u6b63\u5728\u52a0\u8f7d\u4fe1\u606f...</span></div>"+"<div class=\"content loading\" style=\"display:none\" id=\"loadingErr\"><span style=\"line-height: normal; padding: 16px 0pt;\">\u5f88\u62b1\u6b49\uff0c\u4fe1\u606f\u52a0\u8f7d\u6ca1\u6709\u6210\u529f<br><a href=\""+this.href+"\">\u8bd5\u8bd5\u770b\u76f4\u63a5\u641c\u7d22\u5427</a></span></div>";
if(!this.popElement){
jQuery("<div id=\"recBox\" class=\"page-pop-tip\"></div>").appendTo("body");
}
this.popElement=jQuery("#recBox");
this.popElement.html(html);
this.clearPage();
var This=this;
this.ref=k.ref?k.ref:"pf_birth";
jQuery("#recBox").unbind();
jQuery("#recBox").hover(function(){
if((new Date().getTime()-This.outOfMarkTime)<=500){
clearTimeout(This.outOfBoxTimer);
}
},function(){
var That=this;
This.outOfBoxTime=new Date().getTime();
This.outOfMarkTimer=setTimeout(function(){
jQuery(That).hide();
},500);
});
this.popElement.css({top:t,left:l}).fadeIn();
},updatePage:function(type,r){
if(r.code==0){
if(r.pages.length<1){
this.loadErr();
}else{
if(type==1){
this.updateSinglePage(r);
}else{
this.updateMutiPage(r);
}
}
}else{
if(r.code==1){
this.loadErr();
}else{
this.loadErr();
}
}
},clearPage:function(){
jQuery("#loadingErr").hide();
jQuery("#pageMutiData").html("").parent().parent().hide();
jQuery("#pageSingleData").html("").parent().hide();
jQuery("#nopage").hide();
},clearTimer:function(){
if(this.outOfMarkTimer){
clearTimeout(this.outOfMarkTimer);
}
if(this.outOfBoxTimer){
clearTimeout(this.outOfBoxTimer);
}
},updateSinglePage:function(r){
var html="";
if(r.pages.length>0){
html+="<a href=\"http://page.renren.com/"+r.pages[0].id+"?ref="+this.ref+"\"class=\"avatar\"><img height=\"50\" width=\"50\" src=\""+r.pages[0].tinyUrl+"\" alt=\""+r.pages[0].name+"\u7684\u516c\u5171\u4e3b\u9875\"  title=\""+r.pages[0].name+"\u7684\u516c\u5171\u4e3b\u9875\"/></a>"+"<div class=\"description\"><a href=\"http://page.renren.com/"+r.pages[0].id+"?ref="+this.ref+"\" class=\"page-name\">"+r.pages[0].name+"</a>"+"<p class=\"page-desc\">"+(r.pages[0].desc?r.pages[0].desc:"")+"</p><p class=\"page-fans\">"+r.pages[0].fans+"\u4f4d\u7c89\u4e1d</p></div>";
}
jQuery("#pageSingleData").html(html).parent().show();
},updateMutiPage:function(r){
var html="";
for(var i=0;i<r.pages.length;i++){
html+="<li><a  href=\"http://page.renren.com/"+r.pages[i].id+"?ref="+this.ref+"\"class=\"avatar\"><img height=\"50\" width=\"50\" src=\""+r.pages[i].tinyUrl+"\" alt=\""+r.pages[i].name+"\u7684\u516c\u5171\u4e3b\u9875\"  title=\""+r.pages[i].name+"\u7684\u516c\u5171\u4e3b\u9875\"/></a>"+"<p class=\"page-name\"><a  href=\"http://page.renren.com/"+r.pages[i].id+"?ref="+this.ref+"\">"+r.pages[i].name+"</a></p>"+"<p class=\"fans\">("+r.pages[i].fans+")</p></li>";
}
jQuery("#pageMutiData").html(html).parent().parent().show();
}};
XN.namespace("XN.page.profile");
XN.page.profile.musicTip=function(){
this.init();
};
XN.page.profile.musicTip.prototype={tip:null,tab:null,closeBtn:null,tipHtml:"\t\t<div style=\"overflow:hidden;zoom:1;width:200px;\">\t\t\t<a style=\"float:right;margin-top:7px;margin-right:3px;\" href=\"#nogo\" onclick=\"return false;\" class=\"x-to-hide\"></a>\t\t\t<div style=\"border:1px solid #F9B967;background:#FFFBC1;padding:5px;color:#555555;\">\t\t\t\t<p style=\"line-height:normal!important;white-space:nowrap;\">\u60f3\u77e5\u9053\u4f60\u548c\u4ed6\u7684\u97f3\u4e50\u76f8\u4f3c\u5ea6\u5417\uff1f</p>\t\t\t</div>\t\t\t<div style=\"width:11px;height:6px;margin-top:-1px;margin-left:20px;background:url(http://a.xnimg.cn/imgpro/arrow/tip-arrow-down-ss.png) 0 0 no-repeat;\"></div>\t\t</div>\t",buildTip:function(){
this.tip=$element("div");
this.tip.innerHTML=this.tipHtml;
},closeTip:function(o){
if(!o.tip){
return;
}
o.tip.remove();
o.tip=null;
new XN.net.xmlhttp({url:"http://music.renren.com/facade/profile/noPop"});
},bindEvent:function(){
var This=this;
XN.event.addEvent(this.closeBtn,"click",function(){
This.closeTip(This);
});
XN.event.addEvent(this.tab,"click",function(){
This.closeTip(This);
});
},pop:function(){
new XN.ui.fixPositionElement({id:this.tip,alignWith:this.tab,alignType:"1-4",offsetX:30,offsetY:8});
},init:function(){
this.buildTip();
this.closeBtn=Sizzle(".x-to-hide",this.tip)[0];
this.tab=$("pMusic_");
this.bindEvent();
this.pop();
}};
(function(){
var _7aa=0;
function initFile(_7ab){
XN.loadFiles(["http://s.xnimg.cn/csspro/module/friendSelector.css","http://s.xnimg.cn/jspro/xn.ui.multiFriendSelectorBox.js","http://s.xnimg.cn/jspro/xn.ui.pager.js"],function(){
XN.ui.multiFriendSelectorBoxForProfile=function(p){
var This=this;
XN.ui.multiFriendSelectorBox.call(this,p);
this.config.selectedClassName="no_select_class";
};
XN.ui.multiFriendSelectorBoxForProfile.prototype=$extend({},XN.ui.multiFriendSelectorBox.prototype);
XN.ui.multiFriendSelectorBoxForProfile.prototype.deselect=function(){
};
XN.ui.multiFriendSelectorBoxForProfile.prototype.buildFriendInnerHTML=function(p){
return "<div style=\"padding: 4px; height: 64px; width: 134px;\"><a class=\"picbox\" style=\"border: 1px solid rgb(177, 193, 225); padding: 2px; display: block; float: left; margin-right: 3px; height: 50px;background:url(none)\" onclick=\"location.href='http://www."+XN.env.domain+"/profile.do?pma=p_profile_m_pub_sharefriendsall_a_profile&id="+p.id+"'\" href=\"http://www."+XN.env.domain+"/profile.do?id="+p.id+"\"\"><span class=\"pic\" style=\"background-image: url("+p.head+"); width: 50px; height: 50px; display: block;\"></span></a><h4 style=\"padding-left: 60px;\"><a style=\"height: 12px;background:url(none)\" onclick=\"location.href='http://www."+XN.env.domain+"/profile.do?pma=p_profile_m_pub_sharefriendsall_a_profile&id="+p.id+"'\" href=\"http://www."+XN.env.domain+"/profile.do?id="+p.id+"\">"+p.name.slice(0,4)+"</a></h4></div>";
};
if(isFunction(_7ab)){
_7ab();
}
initFile=tempFun;
});
}
function tempFun(_7af){
if(isFunction(_7af)){
_7af();
}
}
function showFriendSelect(conf){
var ELID="cross_page_multiFriendSelector"+_7aa;
_7aa++;
var _7b2=XN.DO.alert({title:conf.title,msg:"<div id=\""+ELID+"\"></div>",width:500,yes:"\u5173\u95ed",callBack:function(r){
}});
_7b2.hide();
try{
var s=new XN.ui.multiFriendSelectorBoxForProfile({createInputElements:false,url:conf.url+"?t="+Math.random(),noFilter:true,autoLoad:false,noCompleteButton:true,noCancelButton:true,noSearchInput:true,noTabView:true,param:{guest:conf.uids},friendsCountPerPage:30});
s.addEvent("load",function(){
if(!s._friendsCount){
if(isFunction(conf.noUser)){
conf.noUser();
}
_7b2.hide();
return;
}
_7b2.show();
});
s.addEvent("noFriends",function(){
if(isFunction(conf.noUser)){
conf.noUser();
}
_7b2.hide();
});
$(ELID).setContent(s);
s.loadFriends();
}
catch(e){
_7b2.hide();
}
}
showShareFriends=function(id){
var _7b6=function(){
showFriendSelect({uids:id,url:"http://friend."+XN.env.domain+"/shareFriends",title:"\u4f60\u4eec\u7684\u5171\u540c\u597d\u53cb"});
};
countKey="sg_friendumayknow";
initFile(_7b6);
};
})();
(function(){
XN.namespace("XN.diyProfileSkin");
XN.env.webmoney=XN.env.webmoney||"\u4eba\u4eba\u8c46";
var _7b7=XN.user.id,_7b8,_7b9=false,_7ba=false,_7bb=1,_7bc=0,_7bd,_7be,_7bf,_7c0,_7c1,_7c2,_7c3,_7c4,_7c5,_7c6,_7c7,_7c8,step=1,popY=320,_7cb=185,url={preview:"http://www."+XN.env.domain+"/profile.do?action=templateNew&tid=",apply:"http://i."+XN.env.domain+"/shop/op/buy2",renew:"http://i."+XN.env.domain+"/shop/op/renew2",give:"http://i."+XN.env.domain+"/store/cart/toGive",req:"http://i."+XN.env.domain+"/storage/request/confirm",getNewSkinList:"http://i."+XN.env.domain+"/store/decorate/newlist",getHotSkinList:"http://i."+XN.env.domain+"/store/decorate/hotlist",buyConfirm:"http://i."+XN.env.domain+"/store/cart/buyconfirm",save:"http://i."+XN.env.domain+"/store/decorate/save",colorTpl:"http://i."+XN.env.domain+"/store/decorate/codeshow",getDiySkin:"http://i."+XN.env.domain+"/store/decorate/decorateshow",photoAlbums:"http://photo."+XN.env.domain+"/app/profile/albums",photos:"http://photo."+XN.env.domain+"/app/profile/album/photos"},_7cd={customDiv:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9004",localUpload:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9005",albumUpload:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9006",nextStep:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9007",preStep:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9008",btnSave:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9009",newTag:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9011",hotTag:"http://i."+XN.env.domain+"/store/decorate/stat?wc=9012",decorateUrl:"?wc=9013"};
function initPara(){
_7be=_7be||"";
_7c0=_7c0||"";
_7c2=_7c2||"250";
_7c3=_7c3||"repeat fixed top center";
_7c4=_7c4||"1";
_7c5=Sizzle("div.full-page-holder")[0];
_7bf=_7bf||$("firstCpl");
addCounts(_7cd.customDiv);
}
function showStep(){
if(step==1){
$("diyProfileContentBottomSave").style.display="none";
$("diyProfileContentBottomNext").style.display="";
$("diyProfileContentBottomPrev").style.display="none";
}else{
$("diyProfileContentBottomSave").style.display="";
$("diyProfileContentBottomNext").style.display="none";
$("diyProfileContentBottomPrev").style.display="";
}
}
function hideStep(){
$("diyProfileContentBottomSave").style.display="none";
$("diyProfileContentBottomNext").style.display="none";
$("diyProfileContentBottomPrev").style.display="none";
}
function addCounts(url){
new XN.net.xmlhttp({url:url,method:"GET"});
}
function setBackground(dir){
if(_7be==""&&_7c0==""){
XN.DO.alert("\u8bf7\u5148\u9009\u62e9\u56fe\u7247\u6216\u4e0a\u4f20\u56fe\u7247");
return false;
}else{
_7c3=dir;
document.body.style.background="url("+_7c0+") "+dir;
}
}
function previewColorTpl(cId,_7d1){
var el=null;
_7c4=cId||"1";
_7d1=_7d1||Sizzle("img",$("colorId_"+cId))[0];
if(!!_7d1){
if(_7bf!=null){
_7bf.className="";
_7bf.parentNode.className="";
}
_7bf=_7d1;
_7d1.className="selected";
_7d1.parentNode.className="selected";
}
new XN.net.xmlhttp({url:url.colorTpl,method:"post",data:"page_color="+_7c4,onSuccess:function(r){
var _7d4=XN.JSON.parse(r.responseText);
$("diyStyleId")&&$("diyStyleId").remove();
jQuery("body").append(_7d4.code);
}});
}
function defalutStyle(){
$("mallStyle")&&$("mallStyle").remove();
$("defaultSkinStyle")&&$("defaultSkinStyle").remove();
}
function diyDivInit(_7d5,_7d6){
var pic="",val=_7d6||"250",_7d9=$("diyProfileMarginTopSelect");
if(_7d5.indexOf("left")>-1){
pic="left";
}else{
if(_7d5.indexOf("right")>-1){
pic="right";
}else{
pic="center";
}
}
$("picposition_"+pic).checked=true;
for(var i=0,l=_7d9.options.length;i<l;i++){
if(_7d9.options[i].text==val){
_7d9.options[i].selected=true;
break;
}
}
}
function getDiySkin(){
new XN.net.xmlhttp({url:url.getDiySkin,method:"GET",onSuccess:function(r){
var _7dd=XN.JSON.parse(r.responseText);
if(_7dd.code==1){
$("diyProfileThumb").style.background="url("+_7dd.picTiny+") no-repeat center center";
$("diyProfileUploadBtn").className="reupload";
_7c0=_7dd.diyImageUrl;
_7c1=_7dd.picTiny;
_7c2=_7dd.topPadding;
_7c3=_7dd.diyImagePosition;
_7c4=_7dd.colorId;
defalutStyle();
previewColorTpl(_7c4);
setBackground(_7c3);
_7c5.style.paddingTop=_7c2+"px";
diyDivInit(_7c3,_7c2);
}
}});
}
function reLocate(){
var w=this.frame;
var s=XN.event.scrollTop();
var _7e0=(XN.event.winHeight()-w.offsetHeight)/2;
_7e0=(_7e0<=0)?s:_7e0+s;
w.style.top=_7e0+"px";
}
function goodsHover(id){
var pli=$(id);
$(id).style.zIndex=2;
$(Sizzle(".inner",pli)[0]).addClass("inner-hover");
$(Sizzle(".buy-msg",pli)[0]).style.display="";
$(Sizzle("h4",pli)[0]).style.display="none";
}
function goodsOut(id){
var pli=$(id);
$(id).style.zIndex=1;
$(Sizzle(".inner",pli)[0]).delClass("inner-hover");
$(Sizzle(".buy-msg",pli)[0]).style.display="none";
$(Sizzle("h4",pli)[0]).style.display="";
}
function apply(_7e5,_7e6,_7e7){
var _url=url.apply;
if(_7e7!=null&&_7e7==true){
_url=url.renew;
}
new XN.net.xmlhttp({url:_url,data:"goods_id="+_7e5+"&kind="+_7e6,onSuccess:function(r){
r=XN.json.parse(r.responseText);
if(r.result){
XN.DO.confirm({title:"\u5e94\u7528\u6210\u529f",message:"<div class=\"pop-s-2\">\t\u606d\u559c\uff01\u88c5\u626e\u5e94\u7528\u6210\u529f\uff01<br/>\u4f60\u53ef\u4ee5\u5230<a href=\"http://i."+XN.env.domain+"/shop/view/mycurrent\">\u5f53\u524d\u88c5\u626e</a>\u4e2d\u67e5\u770b\u88c5\u626e\u4fe1\u606f<br/>\u60a8\u7684\u8d26\u6237\u4f59\u989d\uff1a<span class=\"gray\"><em>"+r.price+"</em>"+XN.env.webmoney+"</span></div>",submit:"\u67e5\u770b\u4e3b\u9875\u6548\u679c",cancel:"\u5173\u95ed",callBack:function(r){
if(r){
window.location.href="http://www."+XN.env.domain+"/profile.do?id="+XN.user.id;
}
}});
}else{
$("postApplySkinFrom").innerHTML="<input type=\"hidden\" name=\"goods_id\" value=\""+_7e5+"\">"+"<input type=\"hidden\" name=\"kind\" value=\""+_7e6+"\">";
$("postApplySkinFrom").action="http://i."+XN.env.domain+"/store/cart/buyconfirm";
$("postApplySkinFrom").submit();
}
}});
}
function give(_7eb,_7ec,_7ed){
if(_7ed!=null&&_7ed==0){
XN.DO.alert({title:"\u6e29\u99a8\u63d0\u793a",message:"\u514d\u8d39\u88c5\u626e\u4e0d\u652f\u6301\u8d60\u9001/\u7d22\u8981\uff0c\u60a8\u548c\u597d\u53cb\u5747\u53ef\u514d\u8d39\u4f7f\u7528\uff01"});
return false;
}else{
var frm=$("postApplySkinFrom");
frm.innerHTML="<input type=\"hidden\" name=\"goods_id\" value=\""+_7eb+"\">"+"<input type=\"hidden\" name=\"kind\" value=\""+_7ec+"\">";
$("postApplySkinFrom").action=url.give;
frm.submit();
}
}
function req(_7ef,_7f0,_7f1){
if(_7f1!=null&&_7f1==0){
XN.DO.alert({title:"\u6e29\u99a8\u63d0\u793a",message:"\u514d\u8d39\u88c5\u626e\u4e0d\u652f\u6301\u8d60\u9001/\u7d22\u8981\uff0c\u60a8\u548c\u597d\u53cb\u5747\u53ef\u514d\u8d39\u4f7f\u7528\uff01"});
return false;
}else{
var frm=$("postApplySkinFrom");
frm.innerHTML="<input type=\"hidden\" name=\"goods_id\" value=\""+_7ef+"\">"+"<input type=\"hidden\" name=\"kind\" value=\""+_7f0+"\">";
$("postApplySkinFrom").action=url.req;
frm.submit();
}
}
function getNewSkinList(){
var _7f3=[];
new XN.net.xmlhttp({url:url.getNewSkinList,method:"GET",onSuccess:function(r){
r=XN.json.parse(r.responseText);
for(var i=0,t=6;i<t;i++){
_7f3[i]=["<li id=\"nli"+r[i].id+"\" onmouseover=\"XN.diyProfileSkin.goodsHover('nli"+r[i].id+"')\" "+_7c8+"=\"XN.diyProfileSkin.goodsOut('nli"+r[i].id+"')\" class=\"\">","<div class=\"li-hover\">","<div class=\"inner\">","<div class=\"img-box\">","<a href=\""+url.preview+r[i].id+"\" target=\"_blank\" onfocus=\"this.blur()\">","<img src=\""+r[i].thumbnail+"\" alt=\""+r[i].name+"\" width=\"152\" height=\"95\">","</a>","<h4>"+r[i].name+"</h4>","<span class=\"label_new\">new</span>","<span class=\"profile_skin\">\u4e3b\u9875\u76ae\u80a4</span>","</div>","<div class=\"buy-msg\" id=\"buyMsg"+r[i].id+"\" style=\"display:none; \">","<div class=\"btn clearfix\">","<a class=\"preview\" target=\"_blank\" href=\""+url.preview+r[i].id+"\" onfocus=\"this.blur()\">\u70b9\u51fb\u9884\u89c8</a>","<a class=\"give\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.give("+r[i].id+", 7, 6)\" onfocus=\"this.blur()\">\u8d60\u9001</a>","<a class=\"ask-for\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.req("+r[i].id+", 7, 6)\" onfocus=\"this.blur()\">\u7d22\u8981</a>","<a class=\"apply\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.apply("+r[i].id+", 7)\" onfocus=\"this.blur()\">\u5e94\u7528</a>","</div>","<p class=\"price\">","<strong>"+r[i].price+"</strong>\u4eba\u4eba\u8c46 | <span style=\"color:#7a4caa;\">VIP\u514d\u8d39\u4f7f\u7528</span>","</p>","</div>","</div>","</div>","</li>"].join("");
}
$("diyProfileNewSkinList").innerHTML=_7f3.join("");
}});
}
function getHotSkinList(){
var _7f7=[];
new XN.net.xmlhttp({url:url.getHotSkinList,method:"GET",onSuccess:function(r){
r=XN.json.parse(r.responseText);
for(var i=0,t=6;i<t;i++){
_7f7[i]=["<li id=\"hli"+r[i].id+"\" onmouseover=\"XN.diyProfileSkin.goodsHover('hli"+r[i].id+"')\" "+_7c8+"=\"XN.diyProfileSkin.goodsOut('hli"+r[i].id+"')\" class=\"\">","<div class=\"li-hover\">","<div class=\"inner\">","<div class=\"img-box\">","<a href=\""+url.preview+r[i].id+"\" target=\"_blank\" onfocus=\"this.blur()\">","<img src=\""+r[i].thumbnail+"\" alt=\""+r[i].name+"\" width=\"152\" height=\"95\">","</a>","<h4>"+r[i].name+"</h4>","<span class=\"label_hot\">hot</span>","<span class=\"profile_skin\">\u4e3b\u9875\u76ae\u80a4</span>","</div>","<div class=\"buy-msg\" id=\"buyMsg"+r[i].id+"\" style=\"display:none;\">","<div class=\"btn clearfix\">","<a class=\"preview\" target=\"_blank\" href=\""+url.preview+r[i].id+"\" onfocus=\"this.blur()\">\u70b9\u51fb\u9884\u89c8</a>","<a class=\"give\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.give("+r[i].id+", 7, 6)\" onfocus=\"this.blur()\">\u8d60\u9001</a>","<a class=\"ask-for\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.req("+r[i].id+", 7, 6)\" onfocus=\"this.blur()\">\u7d22\u8981</a>","<a class=\"apply\" href=\"#nogo\" onclick=\"XN.diyProfileSkin.apply("+r[i].id+", 7)\" onfocus=\"this.blur()\">\u5e94\u7528</a>","</div>","<p class=\"price\">","<strong>"+r[i].price+"</strong>\u4eba\u4eba\u8c46 | <span style=\"color:#7a4caa;\">VIP\u514d\u8d39\u4f7f\u7528</span>","</p>","</div>","</div>","</div>","</li>"].join("");
}
$("diyProfileHotSkinList").innerHTML=_7f7.join("");
}});
}
function uploadCheck(){
var file=$("diyProfileUploadPhoto").value;
if(file!=""){
var e=file.toLowerCase();
if(!/\.(png|jpg|jpeg|gif|bmp)$/i.test(e)){
XN.DO.alert("\u56fe\u7247\u683c\u5f0f\u53ea\u80fd\u4e3apng\uff0cjpg\uff0cgif");
return false;
}else{
$("diyProfileUploadBtn").className="uploading";
$("uploadForm").submit();
}
}
addCounts(_7cd.localUpload);
}
function formCallback(obj){
if(obj.code==0){
_7c0="http://fmn.rrimg.com/"+obj.files[0].images[0].url;
_7c1="http://fmn.rrimg.com/"+obj.files[0].images[1].url;
$("diyProfileUploadBtn").className="reupload";
setBackground(_7c3);
$("diyProfileThumb").style.background="url("+_7c1+") no-repeat center center";
defalutStyle();
previewColorTpl(_7c4);
_7c5.style.paddingTop=_7c2+"px";
}
}
function savePicConfig(){
new XN.net.xmlhttp({url:url.save,method:"post",data:"bg_url="+_7c0+"&bg_img_position="+_7c3+"&top_height="+_7c2+"&page_color="+_7c4+"&picTiny="+_7c1,onSuccess:function(r){
var _7ff=XN.JSON.parse(r.responseText);
if(_7ff.code==1){
XN.DO.alert("\u81ea\u5b9a\u4e49\u88c5\u626e\u4fdd\u5b58\u6210\u529f");
_7b8.remove();
step=1;
}
}});
addCounts(_7cd.btnSave);
}
function colorSelectorInit(_800){
if(!!_800){
var img=$("colorId_"+_800+" img");
if(!!img){
}
}
}
function colorConfigStyle(){
$("diyProfileContentMid").style.display="none";
$("diyProfileContentColor").style.display="block";
$("diyProfileContentBottomNext").style.display="none";
$("diyProfileContentBottomPrev").style.display="";
$("diyProfileContentBottomSave").style.display="";
var _802=Sizzle("li",$("diyProfileContentTopSubNav"));
_802[0].className="";
_802[1].className="arrow-selected";
_802[2].className="selected";
_802[3].className="arrow-hover";
previewColorTpl(_7c4);
}
function gotoColorConfig(){
if(_7be==""&&_7c0==""){
XN.DO.alert("\u8bf7\u5148\u9009\u62e9\u56fe\u7247\u6216\u4e0a\u4f20\u56fe\u7247");
return false;
}
_7c5.style.paddingTop=_7c2+"px";
colorConfigStyle();
}
function picConfigStyle(){
$("diyProfileContentMid").style.display="block";
$("diyProfileContentColor").style.display="none";
$("diyProfileContentBottomNext").style.display="";
$("diyProfileContentBottomPrev").style.display="none";
$("diyProfileContentBottomSave").style.display="none";
var _803=Sizzle("li",$("diyProfileContentTopSubNav"));
_803[0].className="selected";
_803[1].className="arrow-hover";
_803[2].className="";
_803[3].className="arrow";
}
function nextBtnEvent(){
XN.event.addEvent($("diyProfileContentBottomNext"),"click",function(){
step=2;
gotoColorConfig();
addCounts(_7cd.nextStep);
});
}
function prevBtnEvent(){
XN.event.addEvent($("diyProfileContentBottomPrev"),"click",function(){
picConfigStyle();
addCounts(_7cd.preStep);
step=1;
});
}
function diyProfileNewTab(){
$("diyProfileHotTab").style.display="none";
$("diyProfileNewTab").style.display="block";
$("diyProfileDiyTab").style.display="none";
$("diyProfileHot").className="";
$("diyProfileNew").className="selected";
$("diyProfileDiy").className="";
hideStep();
}
function diyProfileHotTab(){
$("diyProfileHotTab").style.display="block";
$("diyProfileNewTab").style.display="none";
$("diyProfileDiyTab").style.display="none";
$("diyProfileHot").className="selected";
$("diyProfileNew").className="";
$("diyProfileDiy").className="";
hideStep();
}
function diyProfileDiyTab(){
$("diyProfileHotTab").style.display="none";
$("diyProfileNewTab").style.display="none";
$("diyProfileDiyTab").style.display="block";
$("diyProfileHot").className="";
$("diyProfileNew").className="";
$("diyProfileDiy").className="selected";
showStep();
initPara();
getDiySkin();
}
function mainNavEvent(){
XN.event.addEvent($("divProfileNav"),"click",function(e){
var el=XN.event.element(e);
switch(el.id){
case "diyProfileNew":
diyProfileNewTab();
getNewSkinList();
addCounts(_7cd.newTag);
break;
case "diyProfileHot":
diyProfileHotTab();
getHotSkinList();
addCounts(_7cd.hotTag);
break;
case "diyProfileDiy":
diyProfileDiyTab();
break;
default:
}
});
}
function scrollLoad(){
XN.event.addEvent($("diyProfilePhotoList"),"scroll",function(e){
var el=XN.event.element(e),_808=el.scrollHeight-264;
if($("diyProfilePhotoList").scrollTop==_808&&!_7ba){
_7bc+=1;
photoDataGen(_7bd,_7bc,false);
}
});
}
function photoListClickEvent(){
XN.event.addEvent($("diyProfilePhotoList"),"click",function(e){
var el=XN.event.element(e);
if(el.nodeName.toUpperCase()=="IMG"){
if(_7be!=""){
_7be.className="";
_7be.parentNode.className="";
}
_7be=el;
el.className="selected";
el.parentNode.className="selected";
_7c1=el.getAttribute("picTiny");
_7c0=el.getAttribute("piclarge");
$("diyProfileThumb").style.background="url("+_7c1+") no-repeat center center";
defalutStyle();
previewColorTpl(_7c4);
_7c5.style.paddingTop=_7c2+"px";
setBackground(_7c3);
}
});
}
function photoDataGen(_80b,page,init){
if(page>=_7bb){
return false;
}
var _80e=[];
new XN.net.xmlhttp({url:url.photos,method:"post",data:"albumId="+_80b+"&curpage="+page,onSuccess:function(r){
r=XN.json.parse(r.responseText);
if(r.code==1){
var _810=r.photoList,_811=_810.length;
if(_811==0){
return false;
}
if(_811<=30){
_7ba=true;
}else{
_7ba=false;
_811=30;
}
if(init){
for(var i=0;i<_811;i++){
_80e[i]="<li><div><img id=\""+_810[i].photoId+"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url("+_810[i].mainUrl+");\" picLarge=\""+_810[i].largeUrl+"\" picTiny=\""+_810[i].mainUrl+"\"></div></li>";
}
scrollLoad();
}else{
_80e[0]=$("diyProfilePhotoList").innerHTML;
for(var i=1;i<=_811;i++){
_80e[i]="<li><div><img id=\""+_810[i-1].photoId+"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url("+_810[i-1].mainUrl+");\" picLarge=\""+_810[i-1].largeUrl+"\" picTiny=\""+_810[i-1].mainUrl+"\"></div></li>";
}
}
$("diyProfilePhotoList").innerHTML=_80e.join("");
photoListClickEvent();
}
}});
}
function albumDataGen(){
var _813=[];
new XN.net.xmlhttp({url:url.photoAlbums,method:"post",onSuccess:function(r){
r=XN.json.parse(r.responseText);
if(r.code==1){
albumList=r.albumList;
_813[0]="\u9009\u62e9\u76f8\u518c\uff1a<select id=\"diyProfileAlbumSelect\" name=\"album-selector\">";
for(var i=1;i<=albumList.length;i++){
_813[i]="<option tpage=\""+Math.ceil(albumList[i-1].photoCount/30)+"\" id=\""+albumList[i-1].albumId+"\" value=\""+albumList[i-1].albumName+"\">"+albumList[i-1].albumName+"\uff08"+albumList[i-1].photoCount+"\u5f20\uff09</option>";
}
_813[albumList.length+1]="</select>";
$("diyProfileAlbumSelector").innerHTML=_813.join("");
_7bc=0;
photoDataGen(albumList[0].albumId,_7bc,true);
_7bd=albumList[0].albumId;
_7bb=Math.ceil(albumList[0].photoCount/30);
selectAlbum();
}
}});
}
function marginTopSelector(){
XN.event.addEvent($("diyProfileMarginTopSelect"),"change",function(e){
if(_7be==""&&_7c0==""){
XN.DO.alert("\u8bf7\u5148\u9009\u62e9\u56fe\u7247\u6216\u4e0a\u4f20\u56fe\u7247");
return false;
}
var e=e||window.event,el=XN.event.element(e),_818=Sizzle("option",el)[el.selectedIndex];
_7c2=_818.value;
_7c5.style.paddingTop=_7c2+"px";
});
}
function selectAlbum(){
XN.event.addEvent($("diyProfileAlbumSelect"),"change",function(e){
var e=e||window.event,el=XN.event.element(e),_81b,_81c=Sizzle("option",el)[el.selectedIndex];
_81b=_81c.id;
_7bd=_81b;
_7bb=parseInt(_81c.getAttribute("tpage"));
_7bc=0;
photoDataGen(_81b,0,true);
});
}
function fromAlbumEvent(){
XN.event.addEvent($("diyProfilefromAlbumBtn"),"click",function(e){
var e=e||window.event;
e.preventDefault();
$("diyProfileTips").style.display="none";
$("diyProfileAlbum").style.display="block";
albumDataGen();
addCounts(_7cd.albumUpload);
});
}
function uploadEvent(){
XN.event.addEvent($("diyProfileUploadBtn"),"click",function(e){
var e=e||window.event;
e.preventDefault();
$("diyProfileAlbum").style.display="none";
$("diyProfileTips").style.display="block";
});
}
function RegisteImgClick(){
var lis=Sizzle("#diyProfileContentColor");
$(lis[0]).delegate("img","click",function(e){
var me=this,num=me.getAttribute("imgIndex");
XN.diyProfileSkin.previewColorTpl(num,me);
});
}
function addAllEvent(){
mainNavEvent();
nextBtnEvent();
prevBtnEvent();
fromAlbumEvent();
uploadEvent();
marginTopSelector();
RegisteImgClick();
getDiySkin();
window.scrollTo(0,_7cb);
}
function popup(){
if(XN.user.isVip){
_7c6="<a id=\"diyProfileContentBottomSave\" class=\"input-submit save\" style=\"display:none;\" onclick=\"XN.diyProfileSkin.savePicConfig()\">\u4fdd\u5b58</a>";
_7c7="margin: 15px 10px 0px 420px;";
}else{
_7c6="<a href=\"http://i.renren.com/pay/pre\" id=\"diyProfileContentBottomSave\" class=\"input-submit save\" style=\"display:none;\" >\u5f00\u901aVIP\u5373\u53ef\u8bbe\u7f6e</a>";
_7c7="margin: 15px 10px 0px 355px;";
}
if(XN.browser.IE6){
_7c8="onmouseleave";
}else{
_7c8="onmouseout";
}
_7b8=XN.DO.confirm({title:"\u4e3b\u9875\u76ae\u80a4",message:["<div class=\"diy-profile-content\">","<a href=\"http://i.renren.com/store/view/home"+_7cd.decorateUrl+"\" style=\"position: absolute;top: 10px;right: 21px;\">\u53bb\u88c5\u626e\u5546\u57ce</a>","<div class=\"diy-profile-content-top\">","<ul id=\"divProfileNav\" class=\"nav\">","<li id=\"diyProfileNew\" class=\"\">\u6700\u65b0\u88c5\u626e</li>","<li id=\"diyProfileHot\" class=\"\">\u70ed\u95e8\u88c5\u626e</li>","<li id=\"diyProfileDiy\" class=\"selected\">\u81ea\u5b9a\u4e49</li>","</ul>","<div id=\"diyProfileNewTab\" style=\"display:none;\">","<ul id=\"diyProfileNewSkinList\">","</ul>","<a class=\"more-skin\" href=\"http://i.renren.com/store/view/home\">\u66f4\u591a\u88c5\u626e&gt;&gt;</a>","</div>","<div id=\"diyProfileHotTab\" style=\"display:none;\">","<ul id=\"diyProfileHotSkinList\">","</ul>","<a class=\"more-skin\" href=\"http://i.renren.com/store/view/home\">\u66f4\u591a\u88c5\u626e&gt;&gt;</a>","</div>","<div id=\"diyProfileDiyTab\" style=\"display:block;\">","<div class=\"sub-nav-content\">","<ul id=\"diyProfileContentTopSubNav\" class=\"sub-nav\">","<li class=\"selected\">\u7b2c\u4e00\u6b65\uff1a\u56fe\u7247\u8bbe\u7f6e</li>","<li class=\"arrow-hover\"></li>","<li>\u7b2c\u4e8c\u6b65\uff1a\u9875\u9762\u914d\u8272</li>","<li class=\"arrow\"></li>","<li>\u7b2c\u4e09\u6b65\uff1a\u4f53\u9a8c\u88c5\u626e</li>","</ul>","</div>","<div id=\"diyProfileContentMid\" class=\"diy-profile-content-mid\" style=\"display:;\">","<div id=\"diyProfileThumb\" class=\"thumb\">","</div>","<div class=\"right-panel\">","<div class=\"pic-position\">","<span>\u56fe\u7247\u4f4d\u7f6e\uff1a</span>","<span class=\"btn\"><input id=\"picposition_left\"  type=\"radio\" name=\"position\" value=\"left\" onclick=\"XN.diyProfileSkin.setBackground('repeat fixed top left')\" />&nbsp;\u5c45\u5de6</span>","<span class=\"btn\"><input id=\"picposition_center\" type=\"radio\" checked=\"checked\" name=\"position\" value=\"middle\" onclick=\"XN.diyProfileSkin.setBackground('repeat fixed top center')\" />&nbsp;\u5c45\u4e2d</span>","<span class=\"btn\"><input id=\"picposition_right\"  type=\"radio\" name=\"position\" value=\"right\" onclick=\"XN.diyProfileSkin.setBackground('repeat fixed top right')\" />&nbsp;\u5c45\u53f3</span>","</div>","<div class=\"margin-top\">","<span>\u9876\u90e8\u9ad8\u5ea6\uff1a</span>","<select id=\"diyProfileMarginTopSelect\" name=\"margin-top\">","<option value=\"250\" selected=\"selected\">250</option>","<option value=\"270\">270</option>","<option value=\"300\">300</option>","</select>","\u50cf\u7d20","</div>","<div class=\"select-btns\">","<a id=\"diyProfilefromAlbumBtn\" class=\"from-album\" href=\"###\" onfocus=\"this.blur()\">\u4ece\u76f8\u518c\u9009\u62e9</a>","<a id=\"diyProfileUploadBtn\" class=\"upload-new\" href=\"###\">\u6b63\u5728\u4e0a\u4f20</a>","<p style=\"display:none;\">\u6b63\u5728\u4e0a\u4f20</p>","<form target=\"uploadPlainIframe\" id=\"uploadForm\" method=\"post\" action=\"http://upload.renren.com/upload.fcgi?pagetype=profileskin&hostid="+_7b7+"&uploadid=1988\" enctype=\"multipart/form-data\">","<div class=\"input-file-wrap\"><input type=\"file\" id=\"diyProfileUploadPhoto\" name=\"diyProfileUploadPhoto\" size=\"1\" onchange=\"XN.diyProfileSkin.uploadCheck()\" /></div>","<input name=\"callback\" type=\"hidden\" value=\"parent.XN.diyProfileSkin.formCallback\" />","</form>","<iframe id=\"uploadPlainIframe\" name=\"uploadPlainIframe\" style=\"display:none;\">","</iframe>","</div>","</div>","<div id=\"diyProfileTips\" class=\"tips\" style=\"display:block;\">","<p class=\"a\"><span>TIPS</span><em style=\"float:left;height:20px;line-height:20px;\">\u5c0f\u63d0\u793a\uff1a</em></p>","<p class=\"b\">1.\u5efa\u8bae\u56fe\u7247\u5bbd\u5ea6\u4e0e\u7535\u8111\u5c4f\u5e55\u5bbd\u5ea6\u76f8\u540c\uff0c\u4ee5\u4fbf\u8fbe\u5230\u6700\u4f73\u6548\u679c\u3002</p>","<p class=\"c\">2.\u652f\u6301\u5927\u5c0f\u4e0d\u8d85\u8fc75M\u7684jpg\u3001gif\u3001png\u56fe\u7247\u4e0a\u4f20\u3002</p>","</div>","<div id=\"diyProfileAlbum\" class=\"fromAlbum\" style=\"display:none;\">","<div id=\"diyProfileAlbumSelector\" class=\"select-album\">\u9009\u62e9\u76f8\u518c\uff1a","<select id=\"diyProfileAlbumSelect\" name=\"album-selector\">","<option value=\"250px\" selected=\"selected\">\u76f8\u518c\u6570\u636e\u8bfb\u53d6\u4e2d...</option>","</select>","</div>","<ul id=\"diyProfilePhotoList\" class=\"photo-list\">","</ul>","</div>","</div>","<div id=\"diyProfileContentColor\" class=\"diy-profile-content-color\" style=\"display:none;\">","<ul class=\"color-selector\">","<li id=\"colorId_1\">","<div class=\"\">","<img id=\"firstCpl\" imgIndex=\"1\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -195px -363px;\">","</div>","<p>\u6696\u767d</p>","</li>","<li id=\"colorId_3\">","<div>","<img imgIndex=\"3\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -5px -240px;\">","</div>","<p>\u571f\u9ec4</p>","</li>","<li id=\"colorId_12\">","<div>","<img imgIndex=\"12\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -100px -240px;\">","</div>","<p>\u6df1\u84dd</p>","</li>","<li id=\"colorId_14\">","<div>","<img imgIndex=\"14\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -195px -240px;\">","</div>","<p>\u7d2b\u7f57\u5170</p>","</li>","<li id=\"colorId_13\">","<div>","<img imgIndex=\"13\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -290px -240px;\">","</div>","<p>\u6a44\u6984\u7eff</p>","</li>","<li id=\"colorId_10\">","<div>","<img imgIndex=\"10\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -5px -301px;\">","</div>","<p>\u6de1\u84dd</p>","</li>","<li id=\"colorId_9\">","<div>","<img imgIndex=\"9\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -100px -301px;\">","</div>","<p>\u6de1\u6a58</p>","</li>","<li id=\"colorId_8\">","<div>","<img imgIndex=\"8\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -195px -301px;\">","</div>","<p>\u6de1\u9ec4</p>","</li>","<li id=\"colorId_4\">","<div>","<img imgIndex=\"4\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -290px -301px;\">","</div>","<p>\u6d45\u7c89</p>","</li>","<li id=\"colorId_15\">","<div>","<img imgIndex=\"15\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -5px -363px;\">","</div>","<p>\u67e0\u6aac\u9ec4</p>","</li>","<li id=\"colorId_2\">","<div>","<img imgIndex=\"2\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -100px -363px;\">","</div>","<p>\u5927\u7ea2</p>","</li>","<li id=\"colorId_11\">","<div>","<img imgIndex=\"11\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -290px -363px;\">","</div>","<p>\u7c89\u7eff</p>","</li>","<li id=\"colorId_6\">","<div>","<img imgIndex=\"6\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -5px -425px;\">","</div>","<p>\u94f6\u7070</p>","</li>","<li id=\"colorId_5\">","<div>","<img imgIndex=\"5\" class=\"\" src=\"http://a.xnimg.cn/a.gif\" style=\"background-image:url(http://a.xnimg.cn/n/apps/profile/res/icons/diyIcon.png);background-position: -100px -425px;\">","</div>","<p>\u70ab\u9ed1</p>","</li>","</ul>","</div>","</div>","</div>","<div class=\"diy-profile-content-bottom\" style=\"text-align:center;\">","<a id=\"diyProfileContentBottomPrev\" class=\"prev\" style=\"display:none;line-height:39x;"+_7c7+"\">\u8fd4\u56de\u4e0a\u4e00\u6b65</a>","<a id=\"diyProfileContentBottomNext\" class=\"input-submit next\">\u4e0b\u4e00\u6b65</a>"+_7c6,"</div>","<form id=\"postApplySkinFrom\" name=\"postApplySkinFrom\" method=\"post\" action=\""+url.buyConfirm+"\" style=\"display:none;\">","</form>","</div>"].join(""),width:580,Y:popY,showCloseButton:true});
_7b8.footer.hide();
_7b8.body.style.padding="0";
initPara();
setTimeout(function(){
addAllEvent();
},0);
}
XN.diyProfileSkin.apply=apply;
XN.diyProfileSkin.give=give;
XN.diyProfileSkin.req=req;
XN.diyProfileSkin.setBackground=setBackground;
XN.diyProfileSkin.savePicConfig=savePicConfig;
XN.diyProfileSkin.previewColorTpl=previewColorTpl;
XN.diyProfileSkin.goodsHover=goodsHover;
XN.diyProfileSkin.goodsOut=goodsOut;
XN.diyProfileSkin.uploadCheck=uploadCheck;
XN.diyProfileSkin.formCallback=formCallback;
XN.dom.ready(function(){
if(parseInt(XN.user.vipLevel)>=3&&XN.profile_owner==XN.user.id){
if($("dressup")){
XN.event.addEvent($("dressup"),"click",function(e){
var e=e||window.event;
e.preventDefault();
popup();
});
}
}else{
return false;
}
});
})();
